使 Windows 快捷方式相对于文件夹所在的位置开始? [英] Making a Windows shortcut start relative to where the folder is?

查看:44
本文介绍了使 Windows 快捷方式相对于文件夹所在的位置开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用这种文件结构的游戏:

I have a game that uses this file structure:

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

我想在 GAME FOLDER 中放置一个 run.bat 的快捷方式,但是如果我移动它,或者其他人安装它,它将不起作用,因为目标错误.有没有办法让目标和开始"相对于 GAME FOLDER?

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?

推荐答案

  1. 右键单击您的/bat/文件夹,然后单击创建快捷方式.

  • 在 Windows 7 上,您将在当前目录中获得 bat - Shortcut.
  • 在 Windows XP 上,您将获得 Shortcut to bat.

右键单击您刚刚创建的快捷方式,然后单击属性.

Right click on the shortcut you just created and click Properties.

Target(在 Windows 7 上的 Shortcut 选项卡下)更改为以下内容:

Change Target (under the Shortcut tab on Windows 7) to the following:

%windir%\system32\cmd.exe /c start "" "%CD%\bat\bat\run.bat"

  • 确保 Start in 为空白.这会导致它在当前目录中启动.

  • Make sure Start in is blank. That causes it to start in the current directory.

    这在快捷方式到 .bat 的情况下可能是可以接受的,但如果您想更改图标,请再次打开快捷方式的属性并单击 更改图标...(再次,在Windows 7 上的快捷方式标签).此时,您可以浏览...图标或通过输入

    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
    

    Browse... 按钮的左侧,然后按 Enter.这适用于 Windows 7 和 Windows XP,但图标因样式更新而不同(但可以识别为相似).根据快捷方式所在的 Windows 版本,图标有时会相应地改变.

    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.

    更多信息:

    参见使用;开始"带有传递给启动程序的参数的命令,以便更好地理解第一个 Target 命令开头的空双引号.

    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.

    这篇关于使 Windows 快捷方式相对于文件夹所在的位置开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆