Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS command to copy shortcut

Status
Not open for further replies.

sstasiak

MIS
Feb 8, 2007
21
0
0
US
Not sure where to put this question, but I'm trying to create a batch file to map a network drive, then copy a shortcut from a folder on that drive to the desktop of the current users profile.

I've tried a bunch of different things, but can't seem to get the copy part to work. Here's what I have for the drive mapping:

net use G: \\bmc-fileserver\public /persistent:yes

Now, there is a folder in the "public" folder named "OncologyRegistry", with a shortcut in that folder named "OncologyRegistry.accdr" that I want to be copied to the desktop of the current user only.

Can anyone help?
 
Try this:
Code:
copy g:\oncologyregistry\oncologyregistry.accdr "%userprofile%\desktop\"

If accdr is part of the filename and not the actual extension (you said it was a shortcut which is normally .lnk) then you will need to add the correct extension to the end of the filename.
 
Thanks crobin, that works after I add the .lnk extension
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top