pcjunki Posted August 16, 2012 Posted August 16, 2012 i've made a simple gui, to help automate killing running tasks on remote pc thought i'd share #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Remote task kill 1.1", 362, 135, 214, 147) $Label1 = GUICtrlCreateLabel("Computer Name", 8, 8, 80, 17) $Input1 = GUICtrlCreateInput("", 8, 24, 137, 21) $combo = GUICtrlCreateCombo("", 152, 24, 193, 25) GUICtrlSetData(-1, "Task_List|taskkill_Outlook|taskkill_notepad") $Button1 = GUICtrlCreateButton("run", 272, 48, 73, 57) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $app = GUICtrlRead($combo) $pc = GUICtrlRead($Input1) Call($app, $pc) EndSwitch WEnd Func task_list($pc) Run(@ComSpec & " /k tasklist /s " & $pc) EndFunc Func taskkill_Outlook($pc) Run(@ComSpec & " /k taskkill /s \\" & $pc & " /im outlook.exe" ) EndFunc Func taskkill_notepad($pc) Run(@ComSpec & " /k taskkill /s \\" & $pc & " /im notepad.exe" ) EndFunc
lordofthestrings Posted August 17, 2012 Posted August 17, 2012 this was too easy wasn't it I suggest you try to make a small gui, use tasklist or pslist (sysinternals) they are both OK. to populate a process list in this gui, and doubleclicking one of the processes returned in the list prompts you to close the executable.. this is not as easy as you might think Kind regards
pcjunki Posted August 17, 2012 Author Posted August 17, 2012 i have no idea how to start doing something like that, way above my head
CiprianD Posted August 29, 2017 Posted August 29, 2017 On 8/16/2012 at 2:16 PM, pcjunki said: i've made a simple gui, to help automate killing running tasks on remote pc thought i'd share #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Remote task kill 1.1", 362, 135, 214, 147) $Label1 = GUICtrlCreateLabel("Computer Name", 8, 8, 80, 17) $Input1 = GUICtrlCreateInput("", 8, 24, 137, 21) $combo = GUICtrlCreateCombo("", 152, 24, 193, 25) GUICtrlSetData(-1, "Task_List|taskkill_Outlook|taskkill_notepad") $Button1 = GUICtrlCreateButton("run", 272, 48, 73, 57) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $app = GUICtrlRead($combo) $pc = GUICtrlRead($Input1) Call($app, $pc) EndSwitch WEnd Func task_list($pc) Run(@ComSpec & " /k tasklist /s " & $pc) EndFunc Func taskkill_Outlook($pc) Run(@ComSpec & " /k taskkill /s \\" & $pc & " /im outlook.exe" ) EndFunc Func taskkill_notepad($pc) Run(@ComSpec & " /k taskkill /s \\" & $pc & " /im notepad.exe" ) EndFunc Expand Thanks for this... How would you modify this script to have it run as an admin on the remote server (that has the appropriate permissions to kill the process)?
spudw2k Posted August 30, 2017 Posted August 30, 2017 You should be able to use RunAs instead of Run and specify credentials...a few comments however. It is not wise to store usernames and passwords in a script. You should consider storing them in another, protected file outside the script. Is this in a domain (AD) environment? If possible, execute the script as the user with admin rights on the remote server and avoid storing credentials at all, Reveal hidden contents Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now