I need to create a batch file that will give me an output if the work folder in my tomcat service was created today or if it wasn't. I have the script mostly written however the main issue I am having is that in server 2008 r2 I cant use %date% to filter which folders appear. the date format is coming back as "Mon 9/26/2011". I need the date to not include the "Mon". Basically i need the dir command to only kick back folder created or modified on today's date. Any suggestions will be greatly appreciated.
Thanks
It sounds like your server is set up with a non-standard short date format. Normally you would expect the format to be "dd/mm/yyyy" but yours seems to be "ddd dd/mm/yyyy". Do you have Administrator access to change this (and if so would it create any other problems)? Alternatively, include the line:
set date2=%date:4,10%
in your batch file and %date2% will contain the date in the format you require.
I do have admin access however the short date format is already listed as dd/mm/yyyy
Try Plan B then.
Yep, that's a better solution. I didn't know about FORFILES; you learn something new every day.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |