New
#1
Help debugging simple .bat that worked on XP
Hello,
I have a backup .bat that I have hobbled together from forums such as this. The original was made a few years ago. It worked flawlessly, until I brought it to windows 7. Very funny, now, it only works between 10am and midnight. This has been hell to figure out because sometimes it works and sometimes it doesn't. I know it has something to do with the context of the "set hour" or "if "%hour.." part, but I can't figure it out. Should be an easy fix for someone familiar with .bat programming. Here is the relevant part:
Let me know if you need more info. I have to hand type the code, since the original is on a non-networked machine. Thanks!Code:set hour=%time:~0,2% if "%hour:0,1%"==" "set hour=0%time:~1,1% set folder=%date:~10,4%_%date:~4,2%_%date:~7,2%-%hour%.%time:~3,2% set DateFolder=%date:~10,4%_%date:~4,2%_%date:7,2%