Fair warning - I'm a "by the seat of my pants" user, so this may be very simple, but I'm stumped:
I'm trying to build a batch file that renames a daily *.prn file to mmddyyyy.txt file.
I know how to rename to today's date, but don't know how to "find" the name of the .prn file - the program that produces the .prn file just gives it an arbitrary name each day.
Using dir *.prn /B will give me just the file name, but how do I stick this in a variable?
I've researched the SET and FOR commands, but not sure what syntax to use:
SET myvar=dir *.prn /B
This gives "dir *.prn /B" as the value of the variable.
And if I enclose the dir *.prn /B in quotes, I get the same result.
Since "dir" isn't a file that the FOR command can find, that didn't work also.
Am I all wet? Any help will be appreciated!
I'm trying to build a batch file that renames a daily *.prn file to mmddyyyy.txt file.
I know how to rename to today's date, but don't know how to "find" the name of the .prn file - the program that produces the .prn file just gives it an arbitrary name each day.
Using dir *.prn /B will give me just the file name, but how do I stick this in a variable?
I've researched the SET and FOR commands, but not sure what syntax to use:
SET myvar=dir *.prn /B
This gives "dir *.prn /B" as the value of the variable.
And if I enclose the dir *.prn /B in quotes, I get the same result.
Since "dir" isn't a file that the FOR command can find, that didn't work also.
Am I all wet? Any help will be appreciated!