MarkDekker Posted January 16, 2010 Author Posted January 16, 2010 (edited) 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 January 16, 2010 by MarkDekker
Juvigy Posted January 18, 2010 Posted January 18, 2010 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now