Create a Shortcut to a non-existing folder in Windows XP

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.


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 (note: direct download link) from Optimum X.

    Shortcut allows you to create, modify or query Windows shell links (shortcuts) from the command-line. You can export the properties of an existing shortcut to a text file in .INI format.

  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.


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.