New
#1
Print Date in txt Output
I have a batch file that outputs a text file for results of ipconfig. How can I add a date to the top of the printed page?
ipconfig /all > c:\users\[username]\ip_config.txt
I have a batch file that outputs a text file for results of ipconfig. How can I add a date to the top of the printed page?
ipconfig /all > c:\users\[username]\ip_config.txt
Use this:
If you need time also use this:Code:DATE /T
Code:TIME /T
Or use this:
Or:Code:ECHO %DATE%
Code:ECHO %TIME%
Or:
Code:ECHO %DATE% %TIME%
Your full code could look like something like this:
Code:@ECHO OFF ECHO %DATE% %TIME% > %USERPROFILE%\ip_config.txt IPCONFIG /ALL >> %USERPROFILE%\ip_config.txt
Last edited by slicendice; 18 Apr 2018 at 14:05.