Sign in to follow this  
Followers 0
Dan Bratt

How to get GUI to close without user intervention...

4 posts in this topic

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 ?

Thanks

RunBackup.au3

Share this post


Link to post
Share on other sites



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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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 :D

Straight from the help file

After running the requested program the script pauses until the program terminates.

idk really im just guessing

Share this post


Link to post
Share on other sites

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

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  
Followers 0