I have the following code:
Code: Select all
@echo off
set "oldname=<oldname.txt"
set "rand=%random%"
echo.
echo OK! Let's get %oldname% a new name!
echo.
echo The new name will be '%rand%'
echo.
rename %oldname%.exe %rand%.exe
echo %rand%>oldname.txt
pause
Whenever I try to run it, where the old name should be, it's blank. This means that it didn't load the contents of 'oldname.txt' properly. I've got no idea how to do this without a 'for' loop, which I find can be complicated etc, etc...
I could ramble on for ages, but I'll keep the dots there
Please help!!
Thanks!!