简体   繁体   English

如何将程序添加到“执行”列表

[英]How to add a program to the 'execute' list

I really don't know how to say, may be this is why I didn't found a solution on Google. 我真的不知道该怎么说,这可能就是为什么我没有在Google上找到解决方案的原因。 My problem is simple. 我的问题很简单。 I want to run program from the execute command just by putting their names and not the path. 我只想通过execute命令来运行程序,只需输入其名称而不是路径即可。 For example type 'myprog' to open 'c:/program/myprog.exe' That's all! 例如,键入“ myprog”以打开“ c:/program/myprog.exe”。 Thanks for your help :) 谢谢你的帮助 :)

  1. Right-click My Computer 右键单击我的电脑
  2. Select Properties 选择属性
  3. Click the Advanced tab 单击高级选项卡
  4. Click Environment Variables 单击环境变量
  5. Select Path from the System variables pane and click Edit 从“ 系统变量”窗格中选择“ 路径 ”,然后单击“ 编辑”。
  6. Append the text ";C:\\path\\to\\folder\\containing\\your\\program" (with the semicolon) 附加文本“; C:\\ path \\ to \\ folder \\ containing \\ your \\ program” (使用分号)

you have to set PATH = c:\\program 您必须设置PATH = c:\\ program

In XP you do that from SYSTEM > ADVANCED > Environment Variables 在XP中,您可以通过SYSTEM> ADVANCED> Environment Variables执行此操作
Add your path to the Path variable (separated with a semi-colon.) 将您的路径添加到Path变量(以分号分隔)。

NOT programming related . 与编程无关。 . . but see here 但是看这里

From the desktop, right-click My Computer and click properties. 在桌面上,右键单击“我的电脑”,然后单击“属性”。 In the System Properties window, click on the Advanced tab. 在“系统属性”窗口中,单击“高级”选项卡。 In the Advanced section, click the Environment Variables button. 在“高级”部分中,单击“环境变量”按钮。 Finally, in the Environment Variables window, highlight the path variable in the Systems Variable section and click edit. 最后,在“环境变量”窗口中,在“系统变量”部分中突出显示路径变量,然后单击“编辑”。 Add or modify the path lines with the paths you wish the computer to access. 使用您希望计算机访问的路径添加或修改路径行。 Each different directory is separated with a semicolon as shown below. 每个不同的目录都用分号分隔,如下所示。

Right click "My Computer" and select properties. 右键单击“我的电脑”,然后选择属性。

Go to Advanced Tab => Environment Variables. 转到高级选项卡=>环境变量。

You will notice there are variables for just your user account and ones for the entire system. 您会注意到,只有您的用户帐户和整个系统都有一些变量。 Assuming you only want this available on your account.... 假设您只想在您的帐户上使用此功能...。

Edit the PATH variable.... there should already be entries in there for things such as Java. 编辑PATH变量...。其中应该已经有诸如Java之类的条目。

At the end of the entry, add a semicolon and the path to the directory of the executable you wish to run from the command line, which in this case is c:/program/ 在条目的末尾,添加分号和要从命令行运行的可执行文件目录的路径,在本例中为c:/ program /

next time you open cmd the command will run. 下次打开cmd时,命令将运行。

You have to put c:\\program in your path. 您必须在路径中放入c:\\ program。 You don't say what operating system you're on but that's what you have to do in XP 您没有说您正在使用什么操作系统,但这是您在XP中必须要做的

What you are asking should work as this facility is provided by your OS. 您的要求应该可以工作,因为此功能由您的操作系统提供。

Ensure that your path in which your programs are stored is in PATH environment variable and windows does not need .exe in name. 确保程序的存储路径在PATH环境变量中,并且Windows名称中不需要.exe。 So if your $PATH variable has C:/Program in it then typing myprog should make it run. 因此,如果您的$ PATH变量中包含C:/ Program,则键入myprog应该可以使其运行。

Open cmd.exe and type path to check which directories are searched for programs. 打开cmd.exe并键入路径以检查在哪些目录中搜索了程序。 All the directories are places where OS will try to find your program. 所有目录都是OS尝试查找程序的位置。

Set your path variable to the directory where it exists and you will be all set 将您的路径变量设置为它存在的目录,您将被全部设置

Setting windows path variables: http://www.cs.usask.ca/~wew036/latex/env.html 设置Windows路径变量: http : //www.cs.usask.ca/~wew036/latex/env.html

If you dont want to go screwing with your path statements, you can also put shortcuts to the programs into one of the folders already in the path. 如果您不想弄乱path语句,也可以将程序的快捷方式放入路径中已经存在的文件夹之一。

Shortcut keys are also handy... I use Ctrl-Alt-C for calculator, Ctrl-Alt-Q for SQL Management studio, etc. They can be setup for any shortcut (like the ones in your start menu) 快捷键也很方便...我将Ctrl-Alt-C用于计算器,将Ctrl-Alt-Q用于SQL Management Studio等。它们可以设置为任何快捷方式(例如开始菜单中的快捷方式)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM