I have been using the following command to get the file date. However, the fileDate
variable has been returning blank value ever since we moved to a different s
It works for me on Vista. Some things to try:
Replace find
with the fully-qualified path of the find command. find
is a common tool name. There's a unix find that is very differet from the Windows built-in find. like this:
FOR /f %%a in ('dir ^|%windir%\system32\find.exe /i "myfile.txt"') DO SET fileDate=%%a
examine the output of the command in a cmd.exe window. To do that, You need to replace the %% with %.
FOR /f %a in ('dir ^|c:\windows\system32\find.exe /i "myfile.txt"') DO SET fileDate=%a
That may give you some ideas.
If that shows up as blank, then again, at a command prompt, try this:
dir | c:\windows\system32\find.exe /i "myfile.txt"
This should show you what you need to see.
If you still can't figure it out from that, edit your post to include what you see from these commands and someone will help you.
You can do it
forfiles /M myfile.txt /C "cmd /c echo @fdate @ftime"