添加一个右击命令行提示符
2006-05-26 13:22
309 查看
If a user types CMD in Windows 2000 to open a CLI (command-line prompt), the CLI opens in the Documents and Settings subfolder for the currently logged-in user. This usually isn't the most convenient place to start a CLI, however. Many people need to open a CLI in an arbitrary folder, and would like to be able to do so without having to type a CD command to change into the folder. With long pathnames, this can be cumbersome and time-consuming.
Windows 2000 has a hidden way to allow an administrator to enable a right-click context menu option to launch a CLI from a particular folder. It can be created on a system after installation, or made part of a system image and rolled out as a standard feature.
To add a right-click CLI context menu option to a system, open the Registry and create a subkey named DosHere in \HKEY_CLASSES_ROOT\Directory\Shell. Rename the existing (Default) REG_SZ value to Dos &Prompt Here (note the & sign). Inside this key, create a subkey called Command and edit its (Default) value. Leave the name of the value as "(Default)" but set the value to:
%SystemRoot%\System32\cmd.exe /k cd "%1".
(Be sure to substitute the name of your system root (e.g. C:) for the %SystemRoot% parameter in the above statement.)
Do the same as above in[/b] \HKEY_CLASSES_ROOT\Drive\Shell[/b]. This will allow you to do the same thing for a drive icon as well as a folder; the two Registry edits operate entirely independently of each other.
Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter. Check out his Windows 2000 blog for his latest advice and musings on the world of Windows network administrators – please share your thoughts as well!
Windows 2000 has a hidden way to allow an administrator to enable a right-click context menu option to launch a CLI from a particular folder. It can be created on a system after installation, or made part of a system image and rolled out as a standard feature.
To add a right-click CLI context menu option to a system, open the Registry and create a subkey named DosHere in \HKEY_CLASSES_ROOT\Directory\Shell. Rename the existing (Default) REG_SZ value to Dos &Prompt Here (note the & sign). Inside this key, create a subkey called Command and edit its (Default) value. Leave the name of the value as "(Default)" but set the value to:
%SystemRoot%\System32\cmd.exe /k cd "%1".
(Be sure to substitute the name of your system root (e.g. C:) for the %SystemRoot% parameter in the above statement.)
Do the same as above in[/b] \HKEY_CLASSES_ROOT\Drive\Shell[/b]. This will allow you to do the same thing for a drive icon as well as a folder; the two Registry edits operate entirely independently of each other.
Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter. Check out his Windows 2000 blog for his latest advice and musings on the world of Windows network administrators – please share your thoughts as well!
相关文章推荐
- 添加一个提示操作正在执行请等待的浮动层的几种方法
- 为你的程序添加“QQ提示”(屏幕的右下角弹出一个提示)
- 今天要为自己的网站添加一个动态检索信息的下拉提示框,这个是在网上找的例子。
- C++ Demo 001: 读取一个从命令行指定的文件,输出文件内容到显示器,并且给每一行输出添加一个行号
- 在UIButton上添加一个UIActivityIndicator来提示操作正在进行
- Ubuntu下添加命令行提示符颜色
- 在UIButton上添加一个UIActivityIndicator来提示操作正在进行
- Delphi 为Edit或是Memo添加一个气球提示
- Unity属性——AddComponentMenu 字面理解:添加 组件选项菜单 分析:可能是添加一个脚本或者组件到一个物体上 验证: 新建一个脚本:AttributeTest 提示:添
- wordpress二次开发教程手记:为文章编辑器添加一个提示消息
- 为notifyIcon添加一个气球提示
- b/s软件中使用Access数据库,只能查询,不能添加、修改、删除,提示操作必须是一个可更新的查询解决。
- 在UIButton上添加一个UIActivityIndicator来提示操作正在进行 (2)
- 如何在FreeRTOS-Plus-CLI中添加一个自己的命令行
- 为 bash 添加 auto_cd 功能:如果命令行是一个目录,则进入该目录
- Linux useradd添加用户后sudo -s导致命令行提示符显示不正常
- 一个简单的Java命令行添加/删除联系人程序(仿C语言)
- 如何给一个输入框添加提示说明
- IOS 为Button添加一个提示数量的角标
- 为一个text 控件添加一个样式,用于提示输入信息