0 pts.
 Stupid Scripting question – what am I missing?
I am brain dead today!! I am trying to create a batch file to copy a shortcut to the startup folder on a Win2K workstation. here is the code: (careful of the word wrap. It is all one line in the batch file) copy Y:notesreg.lnk %userprofile%Start MennuProgramsStartup I get invalid syntax error. Anyone got a suggestion?? (Damn I feel stupid today!)

Software/Hardware used:
ASKED: February 23, 2005  11:51 AM
UPDATED: February 25, 2005  11:23 AM

Answer Wiki:
"menu" has two N's... was that on purpose?
Last Wiki Answer Submitted:  February 23, 2005  12:05 pm  by  Tegryan   0 pts.
All Answer Wiki Contributors:  Tegryan   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Try this:

copy Y:notesreg.lnk “%userprofile%Start MenuProgramsStartup” /y

 0 pts.

 

Menu has two N’s in it.

I tried posting a reply earlier, didn’t work for some reason, sorry if it ends up with a double post.

T

 0 pts.

 

try copy y:notesreg.lnk %userprofile%”Start Menu”ProgramsStartup /y

 0 pts.

 

add double quotes (“) around source and destination if they contain spaces, so that copy command doesn’t split them.

replace :
copy Y:notesreg.lnk %userprofile%Start MennuProgramsStartup
with:
copy Y:notesreg.lnk “%userprofile%Start MennuProgramsStartup”

 0 pts.

 

It should be:
copy Y:notesreg.lnk “%userprofile%Start MenuProgramsStartup”

(all one line of course)

You may want to add a /y to overwrite just in case.
copy /y Y:notesreg.lnk “%userprofile%Start MenuProgramsStartup”

Or you could do this:

if not exist “%userprofile%Start MenuProgramsStartupnotesreg.lnk” copy Y:notesreg.lnk “%userprofile%Start MenuProgramsStartup”

Since Y is a mapped drive, you may want to use UNC paths instead.

David Figueroa

 0 pts.

 

I see no backslashes – maybe the forum is stripping them? There should be a backslash between each folder name. Also, somewhere in the dregs of my memory, an environment variable in a batch file requires two % signs, e.g. %%userprofile%%

 0 pts.

 

Thanks Everyone for the help. It was the double quotes issue.

I appreciated all of your input.

 0 pts.

 

the forum is definitely removing back slash characters.. I know I had it in mine when I typed it out.

 0 pts.