Jump to content

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


Recommended Posts

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

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...