jerome Posted October 28, 2006 Share Posted October 28, 2006 Hi, A simple autoit application that locks the computer before going away... To put in start menu or on desktop... JérômeLock.zip Link to comment Share on other sites More sharing options...
_Kurt Posted October 28, 2006 Share Posted October 28, 2006 Nice job, works great! Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Jango Posted October 31, 2006 Share Posted October 31, 2006 Hi, This is a cool (and short script). Is there a way to do a LOGOFF in the same way ? The goal is to do an automatic logoff on a server after an inactivity lap time... I prefere a logoff instead of a lock Link to comment Share on other sites More sharing options...
fisofo Posted October 31, 2006 Share Posted October 31, 2006 Why not just do a Win+L? Link to comment Share on other sites More sharing options...
jerome Posted October 31, 2006 Author Share Posted October 31, 2006 Why not just do a Win+L?Hi all,I belive that the answer of your question is above your question, it's like why autoIt? To automate things!To reply Jango, yes, there is a solution:Func PowerdownComputer() Shutdown($C_POWERDOWN+$C_FORCE)EndFuncFunc RebootComputer() Shutdown($C_REBOOT+$C_FORCE)EndFuncFunc LogOffComputer() Shutdown($C_LOGOFF+$C_FORCE)EndFuncFunc LockComputer() DllCall("user32.dll", "int", "LockWorkStation")EndFuncEnjoy...JD Link to comment Share on other sites More sharing options...
fisofo Posted November 1, 2006 Share Posted November 1, 2006 Hi all,I belive that the answer of your question is above your question, it's like why autoIt? To automate things!To reply Jango, yes, there is a solution:Func PowerdownComputer() Shutdown($C_POWERDOWN+$C_FORCE)EndFuncFunc RebootComputer() Shutdown($C_REBOOT+$C_FORCE)EndFuncFunc LogOffComputer() Shutdown($C_LOGOFF+$C_FORCE)EndFuncFunc LockComputer() DllCall("user32.dll", "int", "LockWorkStation")EndFuncEnjoy...JDMeant no offense chap, just seems to me it is already "automated." However, a script for logoff and reboot would prove a bit more useful. For those that don't know it, an Alt+F4 from the desktop will also bring up the logoff/restart/shutdown menu... but of course a hotkey is quicker. Link to comment Share on other sites More sharing options...
M4M Posted November 1, 2006 Share Posted November 1, 2006 (edited) not to sound rude myself, but a simple batch file can do the same thing....I have several batch files on my desktop that I run on a regular basis:defrag onlydefrag-n-shutdownforce rebootfor example I will post em.....Forced reboot.....@ echo off title Force Reboot echo NOTICE! This is a FORCED reboot! echo If your PC is running fine and wish to do echo a normal reboot, then close this window echo and choose restart from the start menu. echo. echo If your PC is acting up and you can't get echo some apps to close in the normal fashion, then echo press any key to force the reboot..... pause > null del null shutdown -r -t 10 -f -c "PC is now being forced to reboot in 10 seconds. This is an intentional reboot."Defrag-n-Shutdown......@ echo off title: M4M's HD Defrag-N-Shutdown Utility defrag c: -f defrag d: -f shutdown -s -t 05 -c "Hard drive defragmention is complete. PC is now shuting down...Defrag only....@ echo off title: M4M's HD Defrag Utility defrag c: -f defrag d: -fNOTE: for the defrag ones you might want to change/add/delete the HD letters (c:, d:) to suite your needs. Also, these are used on WinXP Pro. They *might* work if you are using win2k, and WONT work on win9x.Just copy each one in a txt and change the "save as" to "All Files (*.*)" save it as whatever.bat Edited November 1, 2006 by M4M Link to comment Share on other sites More sharing options...
Jango Posted November 2, 2006 Share Posted November 2, 2006 Thank you jerome In fact these script are for our several server It happens that we forget to do a logoff when logged in administrator so if the server do an auto logoff after 15 min of inactivity it's safer 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