Sign in to follow this  
Followers 0
IndyUK

Running a script while PC locked

9 posts in this topic

Hi All,

I'm stuck with the problem of how to run the script while the PC is locked. I've been doing a lot of my development using Remote Desktop and running things while logged in. However, just today I decided to stress test my script and left it to run. I disconnected my remote session and left it for an hour. When I returned I noticed it hadn't done anything apart from launch the application. I've ready quite a few posts in the forum which more or less say it can't be done. Some users did say not to use Send ("xxxxx") as that will definately stop things, instead use ControlSend. Problem I have is the application is Java and therefore has to be driven using MouseMove and Send commands.

Unforunately to leave the PC unlocked is not an option - organisation has a very strict security policy.

Does anyone have any pointers on this or am I doomed? :mellow:

Thanks

Share this post


Link to post
Share on other sites



When using Remote Desktop as soon as you disconnect the session the remote PC is locked. I have been unable to find anyway to stop the remote PC from being locked. As you have discovered when a PC is locked it is impossible to run any scripts. The only way around this is to not close the Remote Desktop session until the script is finished. One solution does work is to use VNC instead. VNC can be configured to leave remote PC unlocked when the session is disconnected.


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

Maybe an option could be a GUI that covers the screen, but move the Java window out of the field of view. This would allow for you to click on the controls, but the unit would be locked in the same manner as a screensaver. You would have to make the GUI in a manner that keeps the user from doing ctrl-alt-del and other stuff like that to keep them out.

Share this post


Link to post
Share on other sites

Thanks guys for coming back.

I've been reading various post on the subject, and there seems to be a claim that it's possible to unlock the PC (using AutoIt), run the script and then lock the PC. Is this true? :mellow:

Share this post


Link to post
Share on other sites

So am I basically stuck?

Share this post


Link to post
Share on other sites

http://www.codeproject.com/KB/system/Remot...Quick&fr=26

Start as a service, and then ctrl alt del the login.

enter the login info after.

Or use psexec.exe

Also try this?

cmd.exe /Q /C "%windir%\System32\tscon.exe 0 /dest:console"

from: http://www-128.ibm.com/developerworks/foru...threadID=181681

Hi Glyph,

Thanks for the pointers. The ultimate problem will be when the Autoit script has been compiled and put on the Windows scheduler to run every 5 mins. The issue isn't running it when remoted in, although that's how discovered the problem. The problem is how can the script execute MoveMouse commands while the PC is locked? I'm trying to drive a Java application and moving the mouse is really the only method of navigating around the application. I'm assuming the problem is because Windows suspends mouse and keyboard messages while locked or even in screen saver mode.

Share this post


Link to post
Share on other sites

Hi Glyph,

Thanks for the pointers. The ultimate problem will be when the Autoit script has been compiled and put on the Windows scheduler to run every 5 mins. The issue isn't running it when remoted in, although that's how discovered the problem. The problem is how can the script execute MoveMouse commands while the PC is locked? I'm trying to drive a Java application and moving the mouse is really the only method of navigating around the application. I'm assuming the problem is because Windows suspends mouse and keyboard messages while locked or even in screen saver mode.

Hey, I don't think there's any work round for that.

Share this post


Link to post
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
Sign in to follow this  
Followers 0