Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Simple .bat file that will make your PC shutdown after given time


15 Mar 2011   #1

Win 7 Pro x64
 
 
Simple .bat file that will make your PC shutdown after given time

I wanted to have something that will make my PC shutdown after given time. I also wanted to keep it as simple as possible, no fancy programs with a lot of options that can be found on internet. So i came up with this batch file. I'm sharing it in case someone would like to use it.

What it does?
It's using window's shutdown program to set amount of time (minutes) after which windows will shutdown itself. You run it, type number of minutes after which you want your PC to shutdown and hit enter. In order to cancel shutdown just run it again.

How to use it?
Just open notepad or any text editor, copy and paste code below into it and save file as "whateveryouwant.bat". Basically anything with .bat extension. Now you can simply run the .bat file by double clicking.

Code:
@ECHO OFF

shutdown /a 2>NUL
IF errorlevel 1 GOTO WYLACZ
GOTO KONIEC


:WYLACZ
SET wylacz=
SET /P wylacz=Shutdown after the number of minutes: 

SET /A wylacz*=60

shutdown /s /t %wylacz%

SET wylacz=


:KONIEC
ECHO ON



My System SpecsSystem Spec
.

Reply

 Simple .bat file that will make your PC shutdown after given time




Thread Tools



Similar help and support threads for2: Simple .bat file that will make your PC shutdown after given time
Thread Forum
Simple php file manager Network & Sharing
Unable to make NEW SIMPLE VOLUME in Windows 7 Installation & Setup
Simple mobile add-ons make big money News
Need suggestions for simple real-time event monitoring. Performance & Maintenance
A simple search by file name General Discussion
How do I Make a SIMPLE Video with Text/Pictures? Music, Pictures & Video
Simple question. Can i make 3 folders stick in taskbar? General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:59 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33