unlock a computer by DOS command

Posted on 2006-04-22
Medium Priority
Last Modified: 2013-12-23

I run some codes on an NT machine. At the end of the code I inserted a system command "logoff" so that when the code execution is completed, the computer automatically logs off. However this only works if the computer is unlocked. When the computer is locked, "logoff" command that is embedded in my code does not work. I was wondering if there is any DOS command that I can embed in my code, so that when the code execution ends, first the computer gets unlocked and then I can call "logoff" command. Thanks.

Question by:cakirfatih
  • 2
LVL 37

Expert Comment

ID: 16516092
> when the code execution ends, first the computer gets unlocked and then I can call "logoff" command.

try to disable the screen saver and run your code again with logoff at the end.

Author Comment

ID: 16516734
this is one solution yes but, for security reasons i need my computer be locked when i am not there.
LVL 37

Expert Comment

ID: 16518335
you can manually lock your workstation. what i meant was that you need to disable the screen saver for properly calling LOGOFF command.
LVL 13

Accepted Solution

masterbaker earned 1000 total points
ID: 16519589
Here you go - straight from Microsoft themselves (a script to do what you need):



Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question