unlock a computer by DOS command

Posted on 2006-04-22
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
    LVL 36

    Expert Comment

    by:Bing CISM / CISSP
    > 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

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

    Expert Comment

    by:Bing CISM / CISSP
    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

    Here you go - straight from Microsoft themselves (a script to do what you need):


    Featured Post

    New My Cloud Pro Series - organize everything!

    With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

    Join & Write a Comment

    Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
    Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now