Making a Windows shortcut start relative to where the folder is?

后端 未结 15 2486
自闭症患者
自闭症患者 2020-11-30 20:36

I have a game that uses this file structure:

GAME FOLDER
->data
->data->run.bat

I want to put a shortcut to run.bat i

15条回答
  •  难免孤独
    2020-11-30 20:57

    The link with a relative path can be created using the mklink command on windows command line.

    mklink /d \MyDocs \Users\User1\Documents
    

    This might be the best way to create link because apparently, the behaviour of shortcut can be different perhaps based on the way they are created (UI vs mklink command). I observed some strange behavior with how the shortcuts behave when I change the root folder.

    • There is a weird behaviour on Windows 7 that I tested. Sometimes the the link still just works when the root folder of target is changed (the shortcut properties automatically update to reflect the changed path!). The "start in" field updates automatically as well if it was there.
    • I also noticed that one link doesn't work the first time I change the root path (properties shows old) but it works after the 2nd and everytime after that. The link properties get updated as result of the first run!
    • I also noticed at least for two link, it doesn't update the path and no longer works.
    • From link properties, there is no difference in format of any fields yet the behaviour is different.

提交回复
热议问题