Jump to content
Sign in to follow this  
BPBNA

FileCopy question

Recommended Posts

BPBNA

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)

Share this post


Link to post
Share on other sites
/dev/null

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 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 *

Share this post


Link to post
Share on other sites
BPBNA

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?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.