Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to create a shortcut, the target of which does not exist (yet). However, as soon as I try to create it, Windows raises an error saying the specified target does not exist.

While I understand why Windows raises this error, I would like to know if there is a way to bypass it.

My file will be located on D:\MyScript.exe, so creating a fake file with this name will not work, since the character \ is forbidden for Windows filenames.

share|improve this question
    
Can you confirm you can create a shortcut to a folder on a CD? –  Dave Jan 14 '13 at 14:44

2 Answers 2

up vote 1 down vote accepted

Shortcut from Optimumx can create shortcuts to non-existing targets.

You will probably run the following command

shortcut /F:example.lnk /A:C /T:D:\MyScript.exe

Sources:
1. Create a Shortcut to a non-existing folder in Windows XP
2. http://www.msfn.org/board/topic/70537-is-there-a-way-to-create-a-shortcut-without-the-source-file/

share|improve this answer
    
Perfect, thanks :) –  NNzz Jan 14 '13 at 15:45

IMO, there is only 1 way, and that is a simple hack.

Create a new file (like a text file), call it the eventual file name with the extension. Of course this file won't work, but Windows will reference it. Then, when you have the real file, just copy it over the top of your dummy file!

share|improve this answer
    
The problem is that my file will be located on D: (CD Reader), so creating a file called D:\myScript.exe will raise the following error : a filename cannot contain \ –  NNzz Jan 14 '13 at 14:34
3  
...Well, to be honest @NNzz I think your OP should have stated that since that's a major part of the question. Please edit your post –  Dave Jan 14 '13 at 14:36
    
I edited my post. –  NNzz Jan 14 '13 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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