IndyUK Posted November 21, 2008 Share Posted November 21, 2008 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? Thanks Link to comment Share on other sites More sharing options...
Bowmore Posted November 21, 2008 Share Posted November 21, 2008 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 Link to comment Share on other sites More sharing options...
Bert Posted November 21, 2008 Share Posted November 21, 2008 I still think your script will fail for it requires the thing to have the Java window active so the script can click on the controls - Even with VNC The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted November 21, 2008 Share Posted November 21, 2008 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. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
IndyUK Posted November 22, 2008 Author Share Posted November 22, 2008 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? Link to comment Share on other sites More sharing options...
IndyUK Posted November 23, 2008 Author Share Posted November 23, 2008 So am I basically stuck? Link to comment Share on other sites More sharing options...
Glyph Posted November 23, 2008 Share Posted November 23, 2008 (edited) http://www.codeproject.com/KB/system/Remot...Quick&fr=26Start as a service, and then ctrl alt del the login.enter the login info after.Or use psexec.exeAlso try this?cmd.exe /Q /C "%windir%\System32\tscon.exe 0 /dest:console"from: http://www-128.ibm.com/developerworks/foru...threadID=181681 Edited November 23, 2008 by Glyph tolle indicium Link to comment Share on other sites More sharing options...
IndyUK Posted November 23, 2008 Author Share Posted November 23, 2008 http://www.codeproject.com/KB/system/Remot...Quick&fr=26Start as a service, and then ctrl alt del the login.enter the login info after.Or use psexec.exeAlso try this?cmd.exe /Q /C "%windir%\System32\tscon.exe 0 /dest:console"from: http://www-128.ibm.com/developerworks/foru...threadID=181681Hi 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. Link to comment Share on other sites More sharing options...
Archer Posted November 24, 2008 Share Posted November 24, 2008 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. Link to comment Share on other sites More sharing options...
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