Skip to content

Instantly share code, notes, and snippets.

@millsy
Created October 16, 2013 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save millsy/7007715 to your computer and use it in GitHub Desktop.
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)
@ 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