Trying to create a shortcut for someone else. It needs to point to files on one of their mapped drives. Instead of waiting for them to be available and create the shortcut on their PC, I was hoping to just create the shortcut on my PC and then transfer it over to their PC.

However Windows tries to validate the path as you create the shortcut and since I don't have access to the same files it is throwing up an error and won't create the shortcut.

Is there a way to create a shortcut without the path being validated?

link|improve this question

60% accept rate
feedback

1 Answer

up vote 5 down vote accepted

You can use this VBScript to create a shortuct:

   Set oWS = WScript.CreateObject("WScript.Shell")
   sLinkFile = "C:\MyShortcut.LNK"
   Set oLink = oWS.CreateShortcut(sLinkFile)
   oLink.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE"
   oLink.Save
link|improve this answer
Thanks. This worked perfectly. – Alistair McMillan Aug 23 '10 at 12:53
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.