Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a shortcut in Windows pointing to a folder which does not yet exist, in a remote server to which I cannot write.

I tried creating any shortcut and overwriting the "Target" field, but when I press 'OK' I get an error because the target cannot be found. Laudable, but I'd like to override it.

Does anyone know how to do that?

I can program (Python) if necessary, but I was wondering if a simpler solution exists.

share|improve this question
No. A simpler solution than Python does not exist :-) – user3463 May 2 '11 at 15:51
up vote 1 down vote accepted

I don't think this is possible - I tried doing it but it didn't quite work as expected. Here's what I did:

  1. Download Shortcut from Optimum X.
  2. Use the following command to create a shortcut (at this stage C:\testfolder didn't exist):

    shortcut /F:example.lnk /A:C /T:C:\testfolder

    The lnk file is created and has all the correct properties, but doesn't work yet. I then created C:\testfolder and checked the shortcut. It pops up the Windows Open With dialogue but doesn't resolve properly as a shortcut.

  3. I ran the above command again and the lnk file was updated and now worked as a proper shortcut.

I doubt this will help in terms of a solution, but should at least hint towards this not being possible in a straightforward way.

share|improve this answer

One easy way to do it is to make a shortcut that uses Explorer instead.

For example, I just made a new shortcut and on Windows 7, it asks for "location of the item". I believe it is called Target on Windows XP.

Just put the following as the target/location:

explorer <desired-dir>

If someone runs the shortcut and the directory is not there, it will just open explorer and navigate to the default directory.

If the directory is there, it will open explorer and successfully go to the desired directory.

share|improve this answer

For those using Cygwin, I wrote a bash script to easily create a shortcut on the current user desktop.

It relies on Optimux shortcut, and is part of ~/.bashrc

$ lnk "C:\fakepath\fakefile.xls"

function lnk #Create shortcut on Windows using Optimux bin
    printf "\033c"
    echo -e "This function allows you to create a shortcut (symbolic link) pointing to a non-existing file on MS Windows\nIt requires having 'Shortcut.exe' from Optimum X placed in System32\nPlease note you MUST single or double quote the shortcut path:\n\t.e.g:\tlnk \"C:\\MyFake\\Folder\\Pointingto\\anonexisting.file\""

    if [ -z "$1" ]; then
        echo -e "\nType the filename path and press [ENTER]"
        read -p "Filepath :  " filepath

    filepath=`cygpath "$filepath"`
    filename=`basename "$filepath"`
    dirpath=`dirname  "$filepath"`
    cmd="shortcut /F:\""$USERPROFILE"\\Desktop\\"$filename".lnk\" /A:C /W:\"`cygpath -w "$dirpath"`\" /T:\"`cygpath -w "$filepath"`\""
    echo "$cmd"
    eval "$cmd"
    echo "File created on your Desktop"
share|improve this answer

Your Answer


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.