|As part of my Batch file logging I keep 2 files as accumulative error logs, one is for INTERNET related errors, and the Other is for COMPUTER related errors. My recent batch for rebooting the router works very well, however I decided that rather than getting into a LOOP situation if the error was external to my network such as due to my INTERNET Service Provider who is coming to fix a problem with my phone line on Wednesday.|
I created 2 logs, which are written to depending on the fault, PC v NET, actions are taken depending on the type of error, if after 3 tries the error is not fixed the server is shut down.
However if after a few days their are no errors I want to zero them out, or delete them if older than 7 days. I like what I read about FORFILES and I downloaded forfiles.exe but it will not work on my windows XP SP3 system perhaps it has some missing DLL files ? My STATUS error log compare files are.
ustable.txt and wanout.txt
Here is my command line in test mode:
FORFILES -p"C:\State" -m*ust*.txt -d"-7" -c "cmd -c del @FILE"
forfiles -p"C:\State" -m*nout.txt -d"-7" -c "cmd -c del @FILE"
I tried all sorts of variations most just do not do anything, not even an error so I’m baffled ?
If I get the format on the line wrong I do get the HELP list from forfiles however but just no functionality of the purpose of forfiles. Need a simple solution.
PS I finally got it working lol the format was very confusing found some tips online this works for me.
forfiles.exe -p"C:\State" -m*.txt -d-7 -c"cmd /c del /q @FILE"
Not even in English but the code was :p
If Dreams Come True Oleg Would be Famous so far he's very shy, so much for Being Famous ;) http://www.book-stores.com/angels-
message edited by Ortorea