November 26, 200421 yr how can i set the date to 01\01\03 then back to the date its sposed 2 be? (like todays date or whatever)thanks
November 26, 200421 yr Author yes i know, but how do i "keep" todays date? maybe as a variable? so i can set it back
November 26, 200421 yr Yes you can but have to strip out the Weekdaydate /t>DateNow.txtReturns Thu 11/25/2004Or do it in a variable
November 26, 200421 yr To get the todays date as a file, you can use this,echo %DATE:~0,10% > c:\DATENOW.txtThen you'll get today's date as a file.And when you want the date BACK again,simply do DATE < c:\DATENOW.txtThis works for me!If you only want the YEAR,echo %DATE:~0,4%If you only want the MONTH,%DATE:~5,2%If you only want the DAY,echo %DATE:~8,3%Change the parameters to fit your needs!
November 26, 200421 yr Author i cant get it 2 import the date again :s your command isnt working 4 meit complains about the date format
November 26, 200421 yr Here's an example...@echo offset realdate=%date:~4%date 01/01/03date /tdate %realdate%date /t
November 26, 200421 yr whmm, I wonder why it didin't work for you.But I guess nakira's way is a lot easier and doesn't fiddle around with making files.My way is another way but can work for other other batch files other than the one it made. Although, I don't think a DATE stuff would e needed any longer than 24 hours! Try it for the TIME method if one needs it. GreenMachine @ EXCREATE forum is better at handling those kinds of things so ask him when he's got time.
November 26, 200421 yr i've got a similar problem (but setting only the year) and i was able to find a way on circumventing it. hope it helps.
Create an account or sign in to comment