[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1115
  • Last Modified:

How to automatically lock Windows 7 after configurable time without using Windows Screen saver

I have a user that is using a fax program that needs to disable the Windows 7 Screen saver (too CPU intensive and will starve comm. threads for fax receive they say).  Fax program works great other than this and do not want to change this program.

Also, the fax program will not work if you log off the computer.  You are only allowed to use the Windows "Lock" for security.

The issue is the user wants to have an automatic way to lock the Windows 7 computer (after 30 minutes for example).  They are using manual Start -> Shutdown -> Lock method now but need automatic method.

Is there a way to do this natively in Windows 7?  If not, is there a good free or inexpensive paid program to do this?

Thanks
0
rdwolf
Asked:
rdwolf
1 Solution
 
MichaelSystems EngineerCommented:
There is a simple way to do this without installing anything. You can do this by holding the Windows key and pressing the L key. This will immediately lock the computer.
0
 
rdwolfAuthor Commented:
KenTankrus:

The need is to do this automically  when the user steps away from desk for greater than 30 minutes. They already know how to do manual method.

So I am still looking for an automatic locking method as stated.

Thanks
0
 
Sean MeyerCommented:
0
 
5g6tdcv4Commented:
Here is a locking exe i wrote in autoit, which is a freeware program you can get here
http://www.autoitscript.com/site/
I have included the pre-compiled exe, an ini file, and the source code which you can compile yourself if you don't want to run my exe.
The exe and the ini file need to be in the same directory. The program defaults to lock at  15 minutes which is 900,000 MS
If you want the computer to autolock at 30 minutes set the "time = " section in the ini file to 3,600,000
This program will also create a shortcut in the %username%\startup folder so that it will persist across reboots.
It will work with win 7 and xp.
If you want to kill the program hitting the ESC will shut it down.

 Lock.exe
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=lock.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt("TrayIconHide", 1)
#include <Timers.au3>
$IdleMinimum  = IniRead(@ScriptDir & "\time.ini", "time", "time", "")
HotKeySet("{ESC}", "_Quit")

if $IdleMinimum  = "" then $IdleMinimum = 900000; Idle time in milliseconds
Select
case	@OSVersion  = "WIN_7"
if not FileExists("C:\Users\" & @UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\lock.lnk")Then
FileCreateShortcut(@scriptdir & "\lock.exe","C:\Users\" & @UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\lock.lnk",@scriptdir)
EndIf
case    @OSVersion  = "WIN_XP"
if not FileExists("C:\Documents and Settings\" & @username & "\Start Menu\Programs\Startup\lock.lnk") Then
FileCreateShortcut(@scriptdir & "\lock.exe","C:\Users\" & @UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\lock.lnk",@scriptdir)
EndIf
EndSelect


While 1
    If _Timer_GetIdleTime() >= $IdleMinimum Then
		Run(@COMSPEC  & " /c" & " rundll32.exe user32.dll, LockWorkStation","",@SW_HIDE)
        Do
            Sleep(100)
        Until _Timer_GetIdleTime() < $IdleMinimum
    EndIf
    Sleep(20)
WEnd

Func _Quit()
    Exit
EndFunc  ;==>_Quit

Open in new window

Lock.exe
time.ini
0
 
rdwolfAuthor Commented:
Thanks for the solution.

I actually ended up just using the Windows 7 screen saver with lock.  I tuned off the screen saver so the computer will lock, after specified time, and now screen saver will come up using CPU cycles that the Fax program can not work with for receive fax queues.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now