Dan Bratt Posted June 23, 2006 Posted June 23, 2006 Hi, I'm having trouble with the attached script. If you look at the attached script, you'll see that I'm trying to display a GUI at the start of the job and then close the GUI at the end. I can't get it to close automatically. What am I doing wrong ? ThanksRunBackup.au3
Valuater Posted June 23, 2006 Posted June 23, 2006 must be within the "runwait" this works ;Programmer: Dan Bratt ;Date: 23-June-2006 ;Purpose: Script to control UPS daily backup #include <GUIConstants.au3> ;$BackupCmd = 'C:\\WINDOWS\\system32\\ntbackup.exe backup "@c:\UPSBackup\UPSDailyBackup.bks" /v:no /r:yes /rs:no /hc:off /m normal /j "UPS Backup" /l:s /f "c:\UPSBackup\UPSDailyBackup.bkf"' ;Opt("GUIOnEventMode",1) GUICreate("Run Backup", 210, 80) $Label = GUICtrlCreateLabel("Running UPS Backup...", 10, 10) GUISetState() ; display the GUI RunBck() GUIDelete() Exit ;--------------- Functions --------------- Func RunBck() MsgBox(0,0,0) ;FileDelete("c:\UPSBackup\UPSDailyBackup.bkf") ;RunWait(@ComSpec & " /c " & $BackupCmd, "", @SW_HIDE) ;FileCopy("c:\UPSBackup\UPSDailyBackup.bkf", "\\sqlsrv\Server Backups$\UPSDailyBackup.bkf",1) EndFunc 8)
Thatsgreat2345 Posted June 23, 2006 Posted June 23, 2006 probaly cuz it takes time for the thing to backup so with the RunWait will wait till the cmd exits but its waiting to finish the backup so it wont delete till after the wait and ur not letting it wait enough Straight from the help file After running the requested program the script pauses until the program terminates. idk really im just guessing
Dan Bratt Posted June 23, 2006 Author Posted June 23, 2006 I figured out that my filecopy was taking over 3 minutes. I'm copying the file to a server on the network. Thanks for getting me pointed in the right direction at least. Regards, DB
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