troubleshooting Question

How to use this AutoHotKey code.

Avatar of juvilux jet
juvilux jet asked on
Scripting LanguagesAutoHotkey
2 Comments1 Solution187 ViewsLast Modified:
Hello Experts, How could i use this Auto Hotkey code (ahk)
closehandle("_circleDock_")

closehandle(name){
	pid := 0
	handle := getHandle(pid,name)
	if (handle = "") {
		return ; handle not found
	}
	command := "C:\Users\Astryd\Risorse\_CircleDocks\handle.exe -p " . pid . " -c " . handle . " -y"
	Run, %comspec% /c %command%,, Hide
	}    
}

getHandle(ByRef pid,name) {
	command := "C:\Users\Astryd\Risorse\_CircleDocks\handle.exe -a " . name
	stdout := runStdout(command)
	needle := "No matching" ;when Handle found nothing return in standard output "No matching handles found."
	IfInString, stdout, %needle%
		{
		return ""
		}	
	handle := RegExReplace(stdout, "s).*(...): \\Sessions\\1\\BaseNamedObjects\\_CircleDock_.*", "$1")
	pid := RegExReplace(stdout, "s).*pid: (\d*).*", "$1")
	Return handle
}

; Run a command and return standard output
runStdout(command) {
    shell := comobjcreate("wscript.shell")
    exec := (shell.exec(comspec " /c " command))
    stdout := exec.stdout.readall()   
    Return stdout
}
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros