Is this VBScript or what?

I would do this, because it's easy to get confused with nested IF
statements.

    Select Case False
    Case Len(Dir("c:\dir\file.1")) = 0
        If MsgBox("Prompt", vbYesNo, "title") = vbYes Then
            FileCopy "Source", "Distination"
        Else
            FileCopy "c:\dir\file.1", "c:\dir\file.2"
            Kill "c:\dir\file.1"
        End If
    Case Len(Dir("c:\dir\file.2")) = 0
        If MsgBox("Prompt", vbYesNo, "title") = vbYes Then
            FileCopy "Source", "Distination"
        Else
            FileCopy "c:\dir\file.2", "c:\dir\file.3"
            Kill "c:\dir\file.2"
        End If
    Case Len(Dir("c:\dir\file.3")) = 0
        If MsgBox("Prompt", vbYesNo, "title") = vbYes Then
            FileCopy "Source", "Distination"
        Else
            FileCopy "c:\dir\file.3", "c:\dir\file.4"
            Kill "c:\dir\file.3"
        End If
    Case Else
        MsgBox "message to user that they must request the file.",
vbInformation, "title"
    End Select


-----Original Message-----
From: William Rogge [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 12:06 PM
To: NT System Admin Issues
Subject: NT 4.0 Scripting dilemma


I have coded '0' login scripts, but now must create one per my boss.

Simply stated, we have a file that we want to push down to each client.  We
also want to allow the client 3 attempts at getting the file.  Reason being
that a lot of them are over dial-up connections and the file is quite
large.

My impression is something like this:

if file.1 exists then
   prompt user if they want it.
   if yes then
      copy file to client
   else
      rename file.1 to file.2
   end if
else
   if file.2 exists then
      prompt user if they want it.
      if yes then
         copy file to client
      else
         rename file.1 to file.2
      end if
   else
      if file.3 exists  then
         prompt user if they want it.
         if yes then
            copy file to client
         else
            rename file.1 to file.2
         end if
      else
         message to user that they must request the file.
      end if
   end if
end if


To me this makes sense, but how does one do this in a login-on script?
 What script commands can be used to accomplish this?

http://www.sunbelt-software.com/ntsysadmin_list_charter.htm






http://www.sunbelt-software.com/ntsysadmin_list_charter.htm

Reply via email to