Categories
Welcome Center
Education & Development
Discussions
Certification Preparation
Recent Posts
Groups
Free Resources
Ebooks
Free Workshops
Trending Certifications Infographic
Infosec Training
IT & Security Training
Live Boot Camps
Security Awareness Training
About Infosec Institute
Home
Discussions
Off Topic
Script to Lock computer after idle for x minutes
qwertyiop
I haven't worked with batch files in a longtime so I'm hoping to get some help from the community.
I have a batch script that needs to execute something after the computer has been idle for x minutes I just can't figure out how to tell if the computer isn't being used.
*Note - These computers aren't on my domain.
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
ptilsen
Task scheduler will detect the idle state and trigger an action on it. If you need an additional arbitrary wait time to execute something, use the timeout command.
apr911
What exactly are you trying to do? Your topic title suggests you are trying to lock a computer after being idle which, even if the computers are not on a domain, can be down via the GPO on the local machine. A domain just allows for centralized management of the GPO and GPO enforcement but there is nothing wrong with deploying a GPO to non-domain computers. Just be aware admin users on the local machine can modify the GPO settings themselves.
If you're trying to do something else when the computer is idle, well I guess that depends on what you are trying to do because there are varying levels of "idle"
Qord
You could powershell it:
Hey, Scripting Guy! How Can I Run a Script When My Computer Is Idle? - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS