View Single Post
  #1 (permalink)  
Old November 13th, 2007, 05:04 PM
ecom ecom is offline
Registered User
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Add Date to File Using Cmd

Hello,

I have a batch file that is executing cmd statements. I am using this code to append the current date to a file before moving it to another location. I now have a need to use yesterday's date instead but don't know how to modify this script to do this. Here is my current date script:

for /F "tokens=1-4 delims=/ " %%i in ('date /t') do (
   set DayOfWeek=%%i
   set Month=%%j
   set Day=%%k
   set Year=%%l
   set Date=%%i %%j/%%k/%%l
)

Thanks!
Reply With Quote