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
You could try the 'Last Written' time options associated with the DIR command
/T:C -- Creation Time and Date
/T:A -- Last Access Time and Date
/T:W -- Last Written Time and Date (default)
DIR /T:W myfile.txt
The output from the above command will produce a variety of additional details you probably wont need, so you could incorporate two FINDSTR commands to remove blank lines, plus any references to 'Volume', 'Directory' and 'bytes':
DIR /T:W myfile.txt | FINDSTR /v "^$" | FINDSTR /v /c:"Volume" /c:"Directory" /c:"bytes"
Attempts to incorporate the blank line target (/c:"^$" or "^$") within a single FINDSTR command fail to remove the blank lines (or produce other errors) when the results are output to a text file.
This is a cleaner command:
DIR /T:W myfile.txt | FINDSTR /c:"/"