Sign in to follow this  
Followers 0
jerome

PC Lock

8 posts in this topic

Hi,

A simple autoit application that locks the computer before going away...

To put in start menu or on desktop...

Jérôme

Lock.zip

Share this post


Link to post
Share on other sites



Nice job, works great!

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Why not just do a Win+L?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 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

Share this post


Link to post
Share on other sites

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 :whistle: so if the server do an auto logoff after 15 min of inactivity it's safer

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