Jump to content

Recommended Posts

Posted

Here is the simple script:

============

RUN("C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe c:\sqlbackup\CAM2000_backup.sql")

WinWaitActive("Connect to Database Engine", "")

sleep(500)

Send("{ENTER}")

sleep(500)

Send("!x")

sleep(15000)

Winclose("Microsoft SQL Server Management Studio Express")

============

It fails sometimes at WinWaitActive. How ControlSend() help me with this then?

Posted

It fails sometimes at WinWaitActive. How ControlSend() help me with this then?

You could try this.

Run('"' & @ProgramFilesDir & '\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe" c:\sqlbackup\CAM2000_backup.sql')
WinWait("Connect to Database Engine")
sleep(500)
ControlSend("Connect to Database Engine", "", "", "{ENTER}")
sleep(500)
ControlSend("Connect to Database Engine", "", "", "!x")
sleep(15000)
Winclose("Microsoft SQL Server Management Studio Express")

Since I see a alt-x being used, meaning that it is a gui application, then you can use ControlClick() to press buttons and checkboxes.

:shocked:

Posted

It's much help for me~

thank you for your help :(

You could try this.

Run('"' & @ProgramFilesDir & '\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe" c:\sqlbackup\CAM2000_backup.sql')
WinWait("Connect to Database Engine")
sleep(500)
ControlSend("Connect to Database Engine", "", "", "{ENTER}")
sleep(500)
ControlSend("Connect to Database Engine", "", "", "!x")
sleep(15000)
Winclose("Microsoft SQL Server Management Studio Express")

Since I see a alt-x being used, meaning that it is a gui application, then you can use ControlClick() to press buttons and checkboxes.

:shocked:

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
×
×
  • Create New...