Jump to content
Sign in to follow this  
Penisaurus

Shutdown()

Recommended Posts

Penisaurus

I've looked over shutdown(), but I can't seem to find the code so it locks my computer..

Is there one? Is it named something else? These are the ones I found in the help file:

0 = Logoff

1 = Shutdown

2 = Reboot

4 = Force

8 = Power down

16= Force if hung

32= Standby

64= Hibernate

Share this post


Link to post
Share on other sites
Penisaurus

You can use PsShutdown to automate this.

So I'm guessing you can't do it regularly?

I wanted to set a hot key type loop so I could press F2 anytime and it would lock my computer.

Share this post


Link to post
Share on other sites
dani

Well sure, you can just set a hotkey which will call psshutdown.exe -l using ShellExecute or an equivalent function.

Btw you do know you can lock your computer using WIN + L, right?

Share this post


Link to post
Share on other sites
Yoriz

I just been playing around with learning basics of dll's from Tutorial on dllcall and one of them just happens to be lockworkstation so here it is :mellow:

DllCall ("User32.dll","BOOL","LockWorkStation")

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites
electrico

+ this (Hardcode method) :mellow: :

$string = String("rundll32.exe user32.dll,LockWorkStation")
Run($string, "", @SW_HIDE)

:(

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.