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
Try this:
copy Y:notesreg.lnk “%userprofile%Start MenuProgramsStartup” /y
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
try copy y:notesreg.lnk %userprofile%”Start Menu”ProgramsStartup /y
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”
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
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%%
Thanks Everyone for the help. It was the double quotes issue.
I appreciated all of your input.
the forum is definitely removing back slash characters.. I know I had it in mine when I typed it out.