dfwcharles
Technical User
I'm using a batch file to delete files based on the file name. The file name is formatted like this: "log07-14-2004.txt"
I need a way to take the current date in DOS and minus it by one day. Here's what i got so far:
@echo on
set currdate=%date%
set mm=%currdate:~4,2%
set dd=%currdate:~7,2%
set yyyy=%currdate:~10,4%
del C:\testlogs\log%mm%-%dd%-%yyyy%.txt
this works for the current day, but i want to run this everyday to delete the file from the previous day. Is there a way to minus one day from the date?
Thanks
I need a way to take the current date in DOS and minus it by one day. Here's what i got so far:
@echo on
set currdate=%date%
set mm=%currdate:~4,2%
set dd=%currdate:~7,2%
set yyyy=%currdate:~10,4%
del C:\testlogs\log%mm%-%dd%-%yyyy%.txt
this works for the current day, but i want to run this everyday to delete the file from the previous day. Is there a way to minus one day from the date?
Thanks