Jump to content

task scheduler question


Recommended Posts

The script only works when i am actually logged in and see the desktop, and when i am not touching anything, if i lock it, the script won't work, the task scheduler than says it completed the task but nothing happened.

This is the same if i log off from the desktop, the task scheduler still says the script is done but nothing happened.

This is the full script:

$app = "c:\data\vmsii\VMSII.exe STATION=a DRIVEPATH=C:\data\VMSII f=1"
run("cmd")
sleep(2000)
WinActivate("C:\WINDOWS\system32\cmd.exe", "")
WinActivate("Customrun")
controlsend( "","","","c:\tame\tame /Uninstall")
controlSend("","","","{ENTER}")
sleep(5000)
controlSend("","","",$app)
controlSend("","","","{ENTER}")
sleep(34000)
ControlSend("","","","2602{Enter}")
sleep(5000)
ControlSend("","","","{RIGHT} & {RIGHT} & {enter}")
sleep(5000)
ControlSend("","","","{down} & {down} & {down} & {down} & {down} & {enter}")
sleep(5000)
ControlSend("","","","0000{Enter}")
ControlSend("","","","9999{Enter}")
sleep(5000)
ControlSend("","","","{enter} & {enter} & {right} & {right} & {right} & {enter}")
sleep(2000)
controlSend("","","","{ENTER}")
sleep(5000)
ControlSend("","","","c:\data\web.txt{Enter}")
sleep(5000)
ControlSend("","","","|{enter}")
sleep(5000)
ControlSend("","","","n{enter} & {right} & {enter} & {enter}")

Edited by MarkDekker
Link to comment
Share on other sites

It seems your application is loosing focus if you touch anything and maybe that is why it is not working when locked.

Try putting some WinWaitActive and WinActivate functions and remove the sleeps.

Also have you tried to run this(c:\data\vmsii\VMSII.exe STATION=a DRIVEPATH=C:\data\VMSII f=1) with shellexecute or Run instead of sending it to CMD?

What exactly is MSII.exe doing?

Link to comment
Share on other sites

  • 1 month later...

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...