Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

batch file help!!!


ghost's Avatar
0 0

i am having a problem with this syn. of this copy i got the first on to work just fine but i can seem to get the second one working

@echo off
echo 				/*******************/
echo 				/                                 /
echo 				/           zer0pain          /
echo 				/                                 /
echo 				/                                 /
echo 				/                                 /
echo 				/*******************/



copy zer0pain.bat c:\

copy zer0pain.bat C:\Documents and Settings\All Users\Start Menu\Programs\Startup




pause

the "copy zer0pain.bat C:\Documents and Settings\All Users\Start Menu\Programs\Startup" part im having trouble with, this batch file is to copy it self to the Startup folder.


ghost's Avatar
0 0

idk if this is giving the problem, but try capitalizing the D in Documents and Settings


ghost's Avatar
0 0

Could add a "/y" afterwords, so it auto dose it without asking y/n been awhile, but that might be it.


ghost's Avatar
0 0

Change it to

markupcopy zer0pain.bat "C:\Documents and Settings\All Users\Start Menu\Programs\Startup"

You need ""s to indicate that the path is one argument, instead of it being 3-4. (Space is normally the delimeter for commands)


Uber0n's Avatar
Member
0 0

It can also be done in the original DOS way (when file names were restricted to 8 chars with no spaces, or had to include a "~" sign)

markupcopy zer0pain.bat C:\docume~1\All~1\Start~1\Programs\Startup

But I recommend the quotes, just wanted to show :D

Peace B)


ghost's Avatar
0 0

Actually, Uber0n, that's probably a better way in case the recognition of ""s for a path is disabled int he system. To my knowledge, DOS style should work regardless of the configuration.


ghost's Avatar
0 0

ty ok so i just out some "" around to get it done … ty


ghost's Avatar
0 0

i'd go with this:

copy zer0pain.bat "%userprofile%\start menu\programs\startup\"zer0pain.bat

WITH the quotes.

you could copy it to %allusersprofile% but i don't know if this syntax works. %userprofile% does work for me :happy:

edit:

the syntax could possibly be:

copy zer0pain.bat "%userprofile%\"start menu\programs\startup\zer0pain.bat


Uber0n's Avatar
Member
0 0

Zekasu wrote: Actually, Uber0n, that's probably a better way in case the recognition of ""s for a path is disabled int he system. To my knowledge, DOS style should work regardless of the configuration.

Yes, it always works (even in MS DOS 1.0 :p) but people tend to get this wrong and write 8 chars then ~1 etc. :right: