' PARSING SECTION PUT THIS NEAR THE TOP OF THE SCRIPT. 'Make sure the script is run with cscript instead of wscript if right(lcase(wscript.fullname), 11) = "wscript.exe" then msgbox "This script must be executed with cscript.exe from the command-line", vbOKOnly + vbCritical, "Error" wscript.quit End if '---(ARUMENTS AND HELP)----------------------------------------------------------- 'If no arguments echo out the help file if objArgs.count = 0 then 'echo out the help file, and quit the script. help() End if for argCounter = 0 to objArgs.count - 1 step 1 Select Case objArgs(argCounter) Case "/?", "-?", "--?", lcase("--help"), lcase("/help"), lcase("-help"), "" help() Case "/DF", lcase("/df") strSourceFile = strSourceFilePath & objArgs(argCounter + 1) Case "/F", lcase("/f") strSourceFile = objArgs(argCounter + 1) Case "/DL", lcase("/dl") strCompListFile = strCompListFilePath & objArgs(argCounter + 1) Case "/L", lcase("/l") strCompListFile = objArgs(argCounter + 1) Case "/D", lcase("/d") strDestFolder = objArgs(argCounter + 1) Case "/E", lcase("/e") boolExecute = TRUE Case "/I", lcase("/i") boolInteractive = TRUE Case "/T", lcase("/t") strTimeOffset = objArgs(argCounter + 1) Case "/M", lcase("/m") strEMail = objArgs(argCounter + 1) boolEMailLog = TRUE End Select Next if strSourceFile = "" Then wscript.stdout.write "Enter the file to be copied: " & strSourceFilePath strSourceFile = strSourceFilePath & Wscript.StdIn.ReadLine end if if strCompListFile = "" Then wscript.stdout.write "Enter the host file: " & strCompListFilePath strCompListFile = strCompListFilePath & Wscript.StdIn.ReadLine end if '---(ARUMENTS AND HELP)----------------------------------------------------------- '///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ' ' help ' ' Variables: ' none ' ' IN: ' none ' ' Actions: ' Echos out the help file ' ' Returns ' Nothing ' ' Developer Notes: ' '///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function help() wscript.echo "Usage: cscript " & wscript.ScriptName & " /f Program.exe /l CompList.txt [/d bin\] [/e] [/I] [/t xx]" wscript.echo vbtab & wscript.ScriptName & " Will silently process .vbs scripts and .reg files." wscript.stdout.writeblanklines 2 wscript.echo vbtab & "/DF" & vbtab & "File to be copied (Default file path: " & strSourceFilePath & ")" wscript.echo vbtab & "/F" & vbtab & "File to be copied (You Supply the path)" wscript.echo vbtab & "/DL" & vbtab & "File listing computers (Default file path: " & strCompListFilePath & ")" wscript.echo vbtab & "/L" & vbtab & "File listing computers (You Supply the path)" wscript.echo vbtab & "/D" & vbtab & "Destination folder. 'C:\' is assumed (Be sure to end the folder path with a '\')" & vbcrlf & vbtab & vbtab & "(Default: " & strDestFolder & ")" wscript.echo vbtab & "/I" & vbtab & "Run command interactive" wscript.echo vbtab & "/E" & vbtab & "Sets the file to be executed" wscript.echo vbtab & "/T xx" & vbtab & "Set timout for execution to xx min. REQUIRES /E (Default: 1)" wscript.echo vbtab & "/M" & vbtab & "E-mail log results to the specified address" wscript.quit end function