I have a SQL job that produces output.txt then I need to rename it with date suffix.
I'm producing output.txt but I can't get the rename to work:
ren w:\dir\output.txt w:\dir\output_%time:~0,2%%time:~3,2%-%DATE:/=%.txt
It fails just running at cmd line with syntax error.
It works without the w:\dir\ but for various boring reasons I can't change the access permissions or use psh or any other more useful software to do this so I have to include the path. It's driving me bonkers and I suspect the answer is dead simple but I'm not even sure what to google for!