|
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
soumitrabajpai
Joined: 23 Feb 2007 Posts: 8
|
|
GUI Automation Macros |
|
Hi,
I have created a GUI Automation Macro. This works fine when I am logged in, but suppose I step out and my machine gets locked, or if I schedule if for early morning the macros fail.
I would like the macro to run even if the machine is locked, but I am logged in.
Any suggestions? Is there any job which can auto login and run the macro, or is there something else that I need to do.
Thank you,
Best Regards,
Soumitra
|
|
Fri Feb 23, 2007 12:04 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
|
|
Well, if the desktop is locked, it is not going to work. Objects to which you send keystrokes and mouse clicks are not visible/active.
What you can do is use the logon utility in the job script to make it unlock your desktop first then you run the MCS macro-script. See http://www.softtreetech.com/24x7/archive/51.htm
In the job script add
Dim( logpid, number)
RunAndWait( "logon.exe -u [user] -p [password]", "", 0, logpid)
MacroPlayBack( .. whatever you have here now
|
|
Fri Feb 23, 2007 12:56 pm |
|
|
soumitrabajpai
Joined: 23 Feb 2007 Posts: 8
|
|
|
|
Hi,
Thank you. This is good. Now I need to lock the machine after I am done:).
Also, can we check if we are not logged in then only try to login
Best Regards,
Soumitra
|
|
Fri Feb 23, 2007 1:21 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
|
|
The logon will simply do nothing if the machine is not locked. If you want to ignore any errors reported by that utility, add OnErrorResumeNext in the beginning of the job script.
|
|
Fri Feb 23, 2007 2:00 pm |
|
|
soumitrabajpai
Joined: 23 Feb 2007 Posts: 8
|
|
|
|
Thanks.
How do I lock the machine after the macro is complete?
I was trying to record a macro for locking the machine, but the recording brakes as soon as I press the keys. So nothing gets recorded
Best Regards,
Soumitra
|
|
Fri Feb 23, 2007 2:04 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
|
|
After macro completion you will need to run something else to lock the Desktop.
For example you can do add to the end of the job script the following line
RunAndWait("rundll32.exe user32.dll, LockWorkStation", "', 0, lockpid)
Another good tool is shutdown.exe provided by Microsoft since Windows 2000. Read the documentation here: http://support.microsoft.com/?kbid=317371
|
|
Fri Feb 23, 2007 2:42 pm |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|