I have a game that uses this file structure:
GAME FOLDER
->data
->data->run.bat
I want to put a shortcut to run.bat
in GAME FOLDER, but if I move it, or someone else installs it it won't work, because the target is wrong. Is there a way to make the target and "start in" relative to GAME FOLDER?
Right click on your /bat/ folder and click Create Shortcut.
bat - Shortcut
in the current directory.Shortcut to bat
.Right click on the shortcut you just created and click Properties.
Change Target (under the Shortcut tab on Windows 7) to the following:
%windir%\system32\cmd.exe /c start "" "%CD%\bat\bat\run.bat"
Make sure Start in is blank. That causes it to start in the current directory.
That's probably acceptable in the case of shortcutting to a .bat but if you want to change the icon, open the shortcut's properties again and click Change Icon... (again, under the Shortcut tab on Windows 7). At this point you can Browse... for an icon or bring up a list of default system icons by entering
%SystemRoot%\system32\SHELL32.dll
to the left of the Browse...
button and hitting Enter. This works on Windows 7 and Windows XP but the icons are different due to style updates (but are recognizably similar). Depending on the version of Windows the shortcut resides, the icon will will sometimes change accordingly.
More Info:
See Using the "start" command with parameters passed to the started program to better understand the empty double-quotes at the beginning of the first Target command.