you need to provide a little bit more info. but there are options here.
- you could supply your own file extension if one is needed
example:
copy filename* %1.txt
this would result in copying a filname of of: document.log to document.log.txt
this would be a valid filename.
- you could set delimiters to define what part of the filnename you wish to insert.
example:
for /f "tokens=1-5" %%A in ('now') do set filename=%%B%%C%%E.txt
echo. >"S:\BackupResults\%filename%"
echo. >>"S:\BackupResults\%filename%"
echo. >>"S:\BackupResults\%filename%"
now is a reskit utility for printing the date and time. what i've done here is use the current date as the naming convention for some log files used in a batch. using tokens, %%A, and set, i've defined which parts of the date/time stamp will be used for the variable "filnename". filename is a variable. you could say set var= instead. then "var" would be your variable. so now when this is run, I get a log file called "Sep132000.txt"
however, without more information, like sample lines from the script and a description of what it is you are trying to do, that's the best I can offer.