自动热键脚本打开命令提示符 [英] Autohotkey script to open command prompt
问题描述
我已经从AutoHotKey
论坛中收集了一个脚本,该脚本使我可以在Windows资源管理器中打开的位置打开命令提示符.如果当前窗口不是资源管理器窗口,则提示会在脚本存在的位置打开.如果当前窗口不是资源管理器窗口,我想更改此行为并使它从C:\
打开.我已经尝试编辑脚本,但是无法按需工作.
I've collected a script from the AutoHotKey
forum which lets me open a command prompt at the location I'm open in windows explorer. If the current window is not a explorer window then the prompt opens at the location where the script is present. I would like to change this behavior and make it open from C:\
if the current window is not a explorer window. I've tried to edit the script but its not working as desired.
#ifwinactive, ahk_class CabinetWClass
ControlGetText, address , edit1, ahk_class CabinetWClass
if (address <> "") {
Run, cmd.exe, %address%
}
else {
Run, cmd.exe, "C:"
}
ExitApp
#ifwinactive
推荐答案
在c:\路径中运行cmd.exe的命令是
The command to run cmd.exe in the c:\ path is
运行,cmd.exe,c:\
run, cmd.exe, c:\
每次都会运行cmd窗口的完整脚本看起来像这样
A full script that would run the cmd window every time would look like this
SetTitleMatchMode, 2
ifwinactive, ahk_class CabinetWClass
ControlGetText, address , edit1, ahk_class CabinetWClass
else
address =
; Exclude specific windows
ifwinactive, My Computer
address =
ifwinactive, My Documents
address =
if (address <> "")
Run, cmd.exe, %address%
else
Run, cmd.exe, C:\
ExitApp
这篇关于自动热键脚本打开命令提示符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!