I have a text file that displays an emergency printer. I would like to configure the batch file under Windows XP to change the default name for the alarm printer to include the date, which would greatly facilitate the search for errors. The alarm printer is written to a text file.
I managed to change the name, but every time I try to set the name to a date, nothing happens or instead of a name instead of a code.
So far i tried
for /f "tokens=1-5 delims=/ "%d in (%date%) do rename "C:\TPM 4 Alarm Printer\test.txt" %%e-%%f-%%g.txt
and
for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set y=%%k for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set d=%%k%%i%%j for /F "tokens=5-8 delims=:. " %%i in ('echo.^| time ^| find "current" ') do set t=%%i%%j set t=%t%_ if "%t:~3,1%"=="_" set t=0%t% set t=%t:~0,4% set "C:\Users\e727896\Desktop\test.txt=%d%%t%" echo %C:\Users\e727896\Desktop\test.txt% –
source share