• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Batch file not working...

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

jack222

Member
Joined
Mar 13, 2005
Code:
@echo off


if exist "C:\%allusersprofile%\Start Menu\Programs\Startup\batch" 

instsrv work c:\toolkit\srvany.exe

:file 
"c:\WINDOWS\notepad.exe"
%0
goto file (
)else(
COPY C:\batch\*.* c:\batch2\*.*/s
)

Code:
@echo off

copy "c:\NoSpyware\noware.bat" "c:\%AllUsersProfile%\Start 

Menu\Programs\Startup\noware.bat"

pause
exit


Neither of those work or copy. The latter one says invalid syntax or something along those lines. I am using XP, SP2...what's wrong with it? The dir EXIST.
 
I don't have the files or directories to test it for myself, but it appears that the problem with the first batch file is an opening parenthesis is in the wrong place (right after "goto file" instead of "if exist blah"). If the second is being displayed correctly, it's problem is the line break that is breaking up your second path.

JigPu
 
Back