You are not logged in.
Pages: 1
I try to make a self-copy bat file.
but it only copy to the next folders.
here is the code.
@echo off
dir /b /a:d > tmp
for /f %%c in (tmp) do (copy /y "%0" "%%c")
for /f %%d in (tmp) do (start "%%d\%~n0.exe")
del /f /q tmp
exit
why it doesn't work in the below folder?
thanks
Offline
In the third line you are starting a .exe file, but the batch script will have the extension .CMD
Offline
Yes. That's a wrong, but it still like the same
Offline
Are the contents of tmp correct? is the copy working?
What do you see if you replace the START with ECHO?
Offline
Pages: 1