Jump to content
Sign in to follow this  
Dan Bratt

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

Recommended Posts

Dan Bratt


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 ?



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"'


GUICreate("Run Backup", 210, 80)

$Label = GUICtrlCreateLabel("Running UPS Backup...", 10, 10)
GUISetState() ; display the GUI
;--------------- Functions ---------------
Func RunBck()
   ;RunWait(@ComSpec & " /c " & $BackupCmd, "", @SW_HIDE)
   ;FileCopy("c:\UPSBackup\UPSDailyBackup.bkf", "\\sqlsrv\Server Backups$\UPSDailyBackup.bkf",1)



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
Dan Bratt

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




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.