用VBS右键菜单中添加 ms-dos
Set WshShell=CreateObject("Wscript.Shell")
WshShell.RegWrite "HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shell\ms-cmd\"," " WshShell.RegWrite "HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shell\ms-cmd\command\",""
WshShell.RegWrite " HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shell\ms-cmd\command\","c:\winnt\system32\cmd.exe /K CD %1","REG_SZ"
WshShell.RegWrite "HKEY_LOCAL_MACHINE\Software\CLASSES\*\shell\ms-cmd\","" WshShell.RegWrite "HKEY_LOCAL_MACHINE\Software\CLASSES\*\shell\ms-cmd\command\","" WshShell.RegWrite "HKEY_LOCAL_MACHINE\Software\CLASSES\*\shell\ms-cmd\command\","c:\winnt\system32\cmd.exe /K CD %1","REG_SZ"
wscript.echo "操作成功" |
说明:
以上脚本2次对注册表操作。
第一次为文件夹的右键菜单中添加ms-dos;第二次为快捷、文档等对象的右键菜单添加ms-dos。
可以将 c:\winnt\system32\cmd.exe 简写为 cmd.exe
操作之后注册表中更新多处(提示,不同分支之间可能有相交的内容):
① CLASSES_ROOT\*\shell\ms-dos
② HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shell\ms-dos
③ CLASSES_ROOT\Folder\shell\ms-dos
④ LOCAL_MACHINE\SOFTWARE\Classes\*\shell\ms-dos
在右键菜单中添加 ms-dos 后可以方便地启动命令行,并且起始点在激活位置。
阅读(1424) | 评论(0) | 转发(0) |