Created
October 16, 2013 13:28
-
-
Save millsy/7007715 to your computer and use it in GitHub Desktop.
Batch file to check a files timestamp version and write the output to a new file (named using a timestamped file name)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ echo off | |
setlocal EnableDelayedExpansion | |
set dd=%date% %Time% | |
set outputFile=C:\Output-Folder\%username%\TimestampChecker-%dd:~4,2%%dd:~7,2%%dd:~10,4%-%dd:~15,2%%dd:~18,2%%dd:~21,2%.txt | |
SET STUDIOFILE=C:\Folder-Name\FileName.dll | |
>%outputFile% 2>&1 ( | |
IF EXIST "%STUDIOFILE%" ( | |
for %%a in ("%STUDIOFILE%") do set STUDIOFILEDATE=%%~ta | |
IF "!STUDIOFILEDATE!"=="" ( | |
echo Could not get %STUDIOFILE% date | |
) else ( | |
echo %STUDIOFILE% date is !STUDIOFILEDATE! | |
) | |
) else ( | |
echo %STUDIOFILE% is not found | |
) | |
) | |
endlocal | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment