First have a look on what is .bat file?
A BAT file is a DOS batch file, which is used to execute commands with the Windows Command Prompt (cmd.exe). It contains a number of lines or you can say commands that are executed to perform specific tasks. A .bat file can be created to perform a single task, or it can be created to perform multiple tasks as well such as starting programs or running maintenance utilities in Windows Operating System.
BAT files are used by DOS or Windows users looking to make repetitive and monotonous tasks easier to complete. You can create BAT files with any text editor, for example you can use Notepad or Wordpad. You can add multiple commands on separate lines that will be executed by the command-line interpreter. To save a batch file, you need tosave it with a .bat extension.
Follow the instructions to make this file:
- First open any text editor.
- Write the following code:
@echo offecho Message here.shutdown.exe -s -f -t 400 -c "here you can write a message to display whenever you open this file"
- In the above code snippet, 400 is time in seconds which means your PC will be turned off automatically after 400 seconds. You can change 400 with any number that does not have any decimal point, and the number you write instead of 400 will be treated as seconds.
- Save this file as name.bat (name can be anything but .bat is must)
- Double click on the saved file, and a pop-up box will open showing count down timer and message you entered in code. You are done.
- To edit this file you need to right click on it then click on edit.
NOTE: THIS FILE CAN ALSO BE USED TO SHUTDOWN YOUR COMPUTER WITHOUT PRESSING ANY KEY COMBINATION OR POWER OPTION OR POWER BUTTON.


No comments:
Post a Comment