Friday, 31 July 2020

How to set timmer and Shut down Computer after 3 hours

How to set Timmer in Batch file ?
How to shutdown computer after 3 hours ?? 

 Syntax   
   timeout   goto  :start  \t   /s

Description:-

This timeout command useful for pausing batch file,  number of seconds

Examples:-

timeout /t 100

Pause programme for 100 seconds. /t back slash t

Sample programme 1 :-

How to find statistic of internet data line for one-hour.

@echo off
:: create file name shut.bat 


timeout  \t  300
:: pause batfile runing in 300 seconds

shutdown  /s \t300
:: shutdown computer after conting 300 seconds

exit

Sample programme 2 :-

@echo off
:: create file name record.bat 
::record directory listing every 5 minutes
:start

dir c:\bat\*.*    >>   c:\bat\dirlist1.txt

timeout  \t  300
:: 300 equal to 5 minutes 

goto start

exit
-----------------------

No comments:

Post a Comment

HOW TO BACKUP YOUR ALL DIRECTORY IN YOUR COMPUTER AND FILE NAMES:-

HOW TO BACKUP YOUR ALL DIRECTORY IN YOUR COMPUTER AND FILE NAMES:-   Syntax         tree   /f Description:- Displays names of files in a dir...