Friday, 24 January 2014

Forfiles delete all files older than 20 days example

Sometimes it is required to delete old backup files and leave only new ones. I never had problems with this on Linux using command find with -exec option, but in case of Windows I had to do some research. As a result the following string will delete all zip files older than 20 days on G drive. I insert this command into a batch file which creates zip backups.
forfiles /P G:\ /S /M *.zip /D -20 /C "cmd /c del @path"

This example is for modern versions of Windows, such as Windows 7 or Windows 2008 Server, but what about Windows XP?  Here is the working example for it:
forfiles -pe:\ -m*.zip -d-20 -c"CMD /C DEL @FILE"

Ping does not work

Today I would like to discuss a banal situation: host A is directly connected to host B, ping from host A to host B does not work. What are...