I am making a batch file where I need it (the batch file) to create another file to do something.
Here is the code I have made so far:
Code: Select all
Set /a R1=%random% * 505000 / 32767 + 800000
Set /a R2=%random% * 505000 / 32767 + 800000
REM
Echo @echo off> "%HomePath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\%R1%.txt"
Echo Rename "%HomePath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\*.bat" "%random%.bat">> "%HomePath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\%R1%.txt"
My problem is: when I open the first batch file, the second one is created in the place that it's made to be, but when I go to edit the second file, the code looks like this:
Code: Select all
@echo off
Set /a R3=21626 * 505000 / 32767 + 800000
Rename "\Users\##NULLED##\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\*.bat" "8603.bat"
And I don't want it to be like that. The "21626" has to be "%random%" and the "8603" has also to be "%random%".
Can someone tell me what am I doing wrong?
Thanks.