So I went back and rewrote the beginning of the script because I wanted the computername var to stay alive between hotkey presses, and that's working great, and when run by itself, it works great, but when incorporated back into my main script with #include when I hit the hotkey the GUI shows up in the Taskbar, but no place else. It is not accessible as a GUI.
Code:
DetectHiddenWindows, on
Gui, Add, Text,, Computer name:
Gui, Add, Edit, vComputerName
Gui, Add, Button, default, SIP ; The label SIP (if it exists) will be run when the button is pressed.
Gui, Add, Button, default, Ping ; The label ping (if it exists) will be run when the button is pressed.
Gui, Add, Button, default, PingCon ; The label pingcon (if it exists) will be run when the button is pressed.
#c:: ; added hotkey win-c
Gui, Show,, TSC GUI
Return ; End of auto-execute section. The script is idle until the user does something.
ButtonSIP:
Gui, Submit ; Save the input from the user to each control's associated variable.
runwait %comspec% /c "psexec.exe \\%ComputerName% "tasklist" /v /fi "IMAGENAME eq System idle process" /fo table /nh > SIP.txt""
Gui, 2:destroy
fileread,sipresults,sip.txt
Gui, 2:add, text,,%sipresults%
Gui, 2:show,w800 h100,Results
return
ButtonPing:
Gui, Submit
;pingresults := ping_("%ComputerName%", "pingresults", "1000")
;msgbox, %pingresults%
return
ButtonPingCon:
Gui, Submit
run, ping %ComputerName% -t
return