I have been trying for 2 days to get the superficially-simple script below working:
for /F "eol=*" %%A in (c:/users/SCTMP000/server.txt) do (echo %%A)
This itself is a reduction of my desired code, which I intended to scroll through the above text file, which is just a list of domains, in order to issue a
TRACERT command against each domain and pipe the output to another text file. But even this simple one-liner won't process the file.
I've seen countless variations of the above cited on MSDN, StackOverflow, this site and many personal developer blogs, so feel that I'm in the right ball-park, but mine won't work ! Depending on how I render the file-name and its path (-ie quoteless, wrapped in single-quotes, wrapped in double-quotes), I see:
[quoteless] - nothing: no file open activity, and therefore no ECHO per line
[double-quoted] - the full path-name ECHOed, ie c:/users/SCTMP000/server.txt
[single-quoted] - the complete file actually opens in NotePad !!
So the path is correct, but neither the script run as a batch file, nor a command run interactively, seems to be able to actually open the text file and scroll through it. Note also that I have tried a number of the line-options: DELIMS, TOKENS, EOL etc, without success.
What am I doing wrong ? Thanks in advance.