네트워커의 보안 티스토리

 F1:: ; messagebox path of active window
WinGet pid, PID, A
; Get WMI service object.
wmi := ComObjGet("winmgmts:")
; Run query to retrieve matching process(es).
queryEnum := wmi.ExecQuery(""
. "Select * from Win32_Process where ProcessId=" . pid)
._NewEnum()
; Get first matching process.
if queryEnum[process]
{
tempclipboard := % process.CommandLine ; e.g., "C:\Program Files (x86)\Notepad++\notepad++.exe" C:\Users\John\Dropbox\File.AHK
newclipboard := regexreplace(tempclipboard, "(\x22)") ; \x22 = straight quotes per the ASCII Codes
newclipboard := regexreplace(newclipboard, "(C(.*)exe)")
newclipboard := regexreplace(newclipboard, "(\s)")
MsgBox, %newclipboard%
tempclipboard = 
newclipboard = 
}
else
MsgBox Process not found!
; Free all global objects (not necessary when using local vars).
wmi := queryEnum := process := ""

return