我無法找到關閉在Windows資源管理器中打開路徑的方法。可以說我想關閉打開的窗口,「c:\ program files」。代碼應該看起來像關閉與自動熱鍵的Windows資源管理器窗口
#::j
close window "c:\program files"
return
謝謝。
我無法找到關閉在Windows資源管理器中打開路徑的方法。可以說我想關閉打開的窗口,「c:\ program files」。代碼應該看起來像關閉與自動熱鍵的Windows資源管理器窗口
#::j
close window "c:\program files"
return
謝謝。
你會想看看這裏:
https://autohotkey.com/docs/commands/WinClose.htm
指定:
WinClose [, WinTitle, WinText, SecondsToWait, ExcludeTitle, ExcludeText]
然後:
#j:: ; Win Key + j
WinClose, C:\Program Files ; close Program Files window
return
另外,關閉所有瀏覽器窗口,使用:
#j:: ; Win Key + j
WinClose, ahk_class CabinetWClass ; closes any explorer window
return
H個
更新的代碼,這裏是一個video stepping through the code:
path := "C:\Program Files"
shell := ComObjCreate("Shell.Application")
shell.open("file:///c:/")
shell.open("file:///" . path)
#If WinExist("ahk_class CabinetWClass") ; explorer
F1::
for window in ComObjCreate("Shell.Application").Windows
if (path == window.Document.Folder.Self.Path)
window.quit()
return
#If
我也試過這個,但是打開的窗口仍然沒有關閉。 – IGRACH
我上面發佈的代碼是與Windows資源管理器連接的最佳方法。如果這根本不起作用,那麼操作系統出現問題,或者您有病毒/惡意軟件。無論哪種情況,您都可能想要進行系統擦除並嘗試重新安裝合法版本的Windows。 – errorseven
更新我的例子,希望它適合你。 – errorseven
如果'winclose'不工作,wasnt有一個'winkill'命令?或者你可以用winclose中的一個參數殺死一個窗口,最後不記得 – Blauhirn
,你也可以嘗試使用'controlsend'發送'!F4'到指定的窗口。但我想你沒有適當地抓住窗戶。先嚐試其他命令,比如'winminimize'。 – Blauhirn