Page 1 of 1 1
Topic Options
#181106 - 2007-10-03 11:02 PM Check if a computer is locked
Adolfo Offline
Fresh Scripter
*****

Registered: 2007-01-25
Posts: 49
Loc: Cali, CO
Hi All

How can I check if a computer is locked else how can I lock it?

Thanks.

Top
#181122 - 2007-10-04 09:50 AM Re: Check if a computer is locked [Re: Adolfo]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
I guess there is some kind of easy way to see if the computer is locked using WMI or something.
Locking it can be done with kix.

Quote from the 4.60 manual page 98/99.
 Code:
SETSYSTEMSTATE
Action
Changes the (power)state of the computer.

Syntax
SETSYSTEMSTATE (mode, force)

Parameters
Mode
Optional parameter specifying one of the following modes:
Value	Action
0	Lock system (supported on Windows 2000 or higher only).
1	Standby.
2	Hibernate.
3	Poweroff.
Force 
Specifies whether applications with unsaved changes are forcibly closed.
If force is not zero, applications are closed.
If force is zero, a dialog box is displayed prompting the user to close the applications. 
Returns

0	Action succeeded
System error code	Action failed


Example
$RC = SetSystemState( 1 , 1 )  ; Force system to StandBy mode


Edited by Mart (2007-10-04 09:52 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 584 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.053 seconds in which 0.027 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org