tegelaar Posted April 29, 2004 Share Posted April 29, 2004 I am trying to copy a file to the local machine via logon script and then execute it. The script is failing because the file does not always copy over. Can I make a loop that will check if the file is there, and if it isn't, try to copy it again? Here is my script so far: DirCreate("C:\DSClient") FileCopy('\\nemaster01\netlogon\dsclient\dsclient.exe', "C:\DSClient\", 1) RunWait('C:\DSClient\DSClient.exe /t:C:\DSClient /c',"", @SW_HIDE) Run('c:\dsclient\setup.exe /q', "C:\dsclient", @SW_HIDE) WinActivate ("System Settings Change") WinWaitActive("System Settings Change") Send("N") DirRemove("C:\DSClient", 1) So after the second line, if c:\dsclient\dsclient.exe doesnt exist, try to copy it again from the share. Incidentally, the script works fine if double clicked on - seems it only fails when running via logon script. Thanks for any help -Jim Link to comment Share on other sites More sharing options...
tegelaar Posted April 29, 2004 Author Share Posted April 29, 2004 I am trying to copy a file to the local machine via logon script and then execute it.The script is failing because the file does not always copy over.Can I make a loop that will check if the file is there, and if it isn't, try to copy it again?Here is my script so far:DirCreate("C:\DSClient")FileCopy('\\nemaster01\netlogon\dsclient\dsclient.exe', "C:\DSClient\", 1)RunWait('C:\DSClient\DSClient.exe /t:C:\DSClient /c',"", @SW_HIDE)Run('c:\dsclient\setup.exe /q', "C:\dsclient", @SW_HIDE)WinActivate ("System Settings Change")WinWaitActive("System Settings Change")Send("N")DirRemove("C:\DSClient", 1)So after the second line, if c:\dsclient\dsclient.exe doesnt exist, try to copy it again from the share.Incidentally, the script works fine if double clicked on - seems it only fails when running via logon script.Thanks for any help-JimHow does this look?DirCreate("C:\DSClient")While NOT FileExists("C:\DSClient\DSClient.exe")FileCopy('\\nemaster01\netlogon\dsclient\dsclient.exe', "C:\DSClient\", 1)WendRunWait('C:\DSClient\DSClient.exe /t:C:\DSClient /c',"", @SW_HIDE)Run('c:\dsclient\setup.exe /q', "C:\dsclient", @SW_HIDE)WinActivate ("System Settings Change")WinWaitActive("System Settings Change")Send("N")DirRemove("C:\DSClient", 1)-Jim Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now