Stupid Scripting question – what am I missing?

pts.
Tags:
DataCenter
Microsoft Windows
Windows 2000 Server
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!)

Answer Wiki

Thanks. We'll let you know when a new response is added.

“menu” has two N’s… was that on purpose?

Discuss This Question: 8  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Ghigbee
    Try this: copy Y:notesreg.lnk "%userprofile%Start MenuProgramsStartup" /y
    0 pointsBadges:
    report
  • Tegryan
    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 pointsBadges:
    report
  • CCbuff
    try copy y:notesreg.lnk %userprofile%"Start Menu"ProgramsStartup /y
    0 pointsBadges:
    report
  • Aleccc
    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 pointsBadges:
    report
  • DavidFigueroa
    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 pointsBadges:
    report
  • Drmikec
    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 pointsBadges:
    report
  • Melvin
    Thanks Everyone for the help. It was the double quotes issue. I appreciated all of your input.
    0 pointsBadges:
    report
  • DavidFigueroa
    the forum is definitely removing back slash characters.. I know I had it in mine when I typed it out.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following