Howto echo or get file timestamp (date) in command (cmd) .bat scriptBy neokrates, written on October 30, 2010 |
cmd bat snippet |
- neokrates
- Email: uwarov@yahoo.com
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 20
Rate it
Ad
Poll
Which tool is used for SCM/VCS in your enterprise?
- Subversion (SVN) (50%, 7 Votes)
- We use no SCM (43%, 6 Votes)
- Mercurial (Hg) (7%, 1 Votes)
- Git (0%, 0 Votes)
- Bazaar (0%, 0 Votes)
- CVS (0%, 0 Votes)
- Other (0%, 0 Votes)
Total Voters: 14
Loading ...
Most popular search terms:
Print timestamp:
for %%a in (myfile.txt) do echo %%~ta
Get timestamp:
for %%a in (myfile.txt) do set myfiledate=%%~ta
To use the myfiledate inside the FOR loop you will probably need to enable delayed expansion (ENABLEDELAYEDEXPANSION), like:
@echo off @SETLOCAL ENABLEDELAYEDEXPANSION for %%a in (myfile.txt) do ( set myfiledate=%%~ta echo !myfiledate! )
|
TAGS
|
|
SOCIAL
|


















