Jump to content

PC Lock


jerome
 Share

Recommended Posts

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)

EndFunc

Func RebootComputer()

Shutdown($C_REBOOT+$C_FORCE)

EndFunc

Func LogOffComputer()

Shutdown($C_LOGOFF+$C_FORCE)

EndFunc

Func LockComputer()

DllCall("user32.dll", "int", "LockWorkStation")

EndFunc

Enjoy...

JD

Link to comment
Share on other sites

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)

EndFunc

Func RebootComputer()

Shutdown($C_REBOOT+$C_FORCE)

EndFunc

Func LogOffComputer()

Shutdown($C_LOGOFF+$C_FORCE)

EndFunc

Func LockComputer()

DllCall("user32.dll", "int", "LockWorkStation")

EndFunc

Enjoy...

JD

Meant 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

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 only

defrag-n-shutdown

force reboot

for 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: -f

NOTE: 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 by M4M
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...