Hi members,
I am trying to convert a unix shell script to dos. It needs to delete all .test files in a directory and write to log file that the command was successful. When there are no files, it should write "no files available" to the logfile.
I have this right now:
SET DIR=C:
SET LOGFILE="C:\test.log"
SET DATE=%mm%%dd%%yyyy%
echo %DATE% >> %LOGFILE%
echo Deleting old .test files > %LOGFILE%
echo "" >> %LOGFILE
del %DIR%\*.test
echo Deleted old .test files > %LOGFILE%
I need to add the if else condition. i.e when there are no files available, it should write the same. Any help will be appreciated.
I am trying to convert a unix shell script to dos. It needs to delete all .test files in a directory and write to log file that the command was successful. When there are no files, it should write "no files available" to the logfile.
I have this right now:
SET DIR=C:
SET LOGFILE="C:\test.log"
SET DATE=%mm%%dd%%yyyy%
echo %DATE% >> %LOGFILE%
echo Deleting old .test files > %LOGFILE%
echo "" >> %LOGFILE
del %DIR%\*.test
echo Deleted old .test files > %LOGFILE%
I need to add the if else condition. i.e when there are no files available, it should write the same. Any help will be appreciated.