BPBNA Posted July 31, 2006 Share Posted July 31, 2006 I have a script that checks if our users have certain security updates and XP Service Pack 2 installed on their machines. Since RunWait seems to have problems running off network drives sometimes, I decided to rewrite the script using FileCopy to write it to the local hard drive and run it from there. Since the Service Pack is about 270mb, it takes a while to download, although I think the script is running the FileCopy command then immediately going to the next command, which of course errors out. Is it just a problem with my scripting or does FileCopy not pause the script until the copy is complete? I dont think you need to see my script but thats the line im using. FileCopy(@ScriptDir & "\files\xpsp2_x86.exe", @HomeDrive & "\xpsp2\xpsp2_x86.exe", 1) Link to comment Share on other sites More sharing options...
/dev/null Posted July 31, 2006 Share Posted July 31, 2006 (edited) Is it just a problem with my scripting or does FileCopy not pause the script until the copy is complete? I dont think you need to see my script but thats the line im using. FileCopy(@ScriptDir & "\files\xpsp2_x86.exe", @HomeDrive & "\xpsp2\xpsp2_x86.exe", 1) Did you check @error after FileCopy()? Does @HomeDrive\xpsp2\ exist before you try to copy a file to that directory? If not, try this: FileCopy(@ScriptDir & "\files\xpsp2_x86.exe", @HomeDrive & "\xpsp2\xpsp2_x86.exe", 8+1) 8+1 == Create dir and overwrite file. Cheers Kurt Edited July 31, 2006 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
BPBNA Posted July 31, 2006 Author Share Posted July 31, 2006 I use this line before the FileCopy If Not FileExists(@HomeDrive & "\xpsp2") then DirCreate(@HomeDrive & "\xpsp2") But I didn't know about that one, seems alot cleaner, thanks. So I'm assuming it is supposed to pause the script until its done? 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