Windows: 也谈“触手可及的命令提示符” (续) : Win7对应

背景介绍 :

 

前面写过一篇博客, 叫做: Windows: 也谈“触手可及的命令提示符”

里面实现了这样的一个功能:

 

 

遇到的新问题:

 

前几天公司的电脑升级到了Windows7 64, 我发现上面那篇博客的做法现在对Win7-64失效了.

调查了一下, 在Win7上面, 要实现上面的功能, 可以使用下面的脚本(附件里面可下载):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\cmd]
@="MS DOS(&Q)"

[HKEY_CLASSES_ROOT\Folder\shell\cmd\command]
@="cmd.exe /k pushd %L"
 

与XP的稍有不同, XP上面的代码如下:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@="MS DOS(&Y)"

[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="cmd.exe cd %1"

 

其他资源 :

 

如果大家和我一样只想要这么一个功能, 那么直接导入上面的注册表即可.

如果大家想对这个问题有个更深入的了解, 可以参考下面的链接.

他们是我调查的过程中发现的, 涉及包括这一功能的其他方法实现, Windows的Build-in功能, UAC等等.

 

前面三个是微软的链接

cmd here in windows 7?

To configure the command prompt

Cmd

后面这三个是其他的链接.

Open Command Window Here

Windows Vista Open Command Prompt Here With Elevated Privilege

"Command prompt here" for files and folders

 

其中, 我尤其喜欢Open Command Window Here 这篇文章.

不仅因为他详细讨论了如何右键支持Windows的命令行提示符,

还因为

①给出了一份有参考价值的资源列表

②介绍了如何在右键菜单里面集成Unix Korn Shell,Unix Bash,Cygwin Bash,PowerShell这些命令行提示符.

这些命令行提示符的集成方式分别如下:

 

Unix Korn Shell:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\sfuksh]
@="Open SFU Ksh Here"
[HKEY_CLASSES_ROOT\Directory\shell\sfuksh\command]
@="C:\\WINDOWS\\system32\\POSIX.EXE /u /c /bin/ksh -l -c \"cd \\\"`chgpath -p '%L'`\\\";ksh\""

 

Unix Bash

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\sfubash]
@="Open SFU Bash Here"
[HKEY_CLASSES_ROOT\Directory\shell\sfubash\command]
@="C:\\WINDOWS\\system32\\POSIX.EXE /u /c /bin/ksh -l -c \"cd \\\"`chgpath -p '%L'`\\\";bash\""
 

 

Cygwin Bash

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\cygwinbash]
@="Open Cygwin Bash Here"
[HKEY_CLASSES_ROOT\Directory\shell\cygwinbash\command]
@="c:\\cygwin\\bin\\bash.exe --login -i -c \"cd \\\"`cygpath -u '%L'`\\\";bash\""
 

PowerShell

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\powershell]
@="PowerShell Here"
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值