markj Posted March 30, 2006 Share Posted March 30, 2006 Hello out there. I am terribly useless at AutoIT but love the capabilities. I want to use a gui to remotely stop a service on a pc using psservice.exe from the pstools suite. I have done the easy bit and created the gui which just has ip username and pw and the stop and start buttons but i am struggling to work out how AutoIT polls the info and plonks it in to the psservice command. heres the code for the gui - all suggestions and help will be greatly appreciated #include <GuiConstants.au3> GuiCreate("Stop and Start Service", 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_IP = GuiCtrlCreateInput("", 150, 20, 150, 20) $Input_UN = GuiCtrlCreateInput("administrator", 150, 50, 150, 20) $Input_PW = GuiCtrlCreateInput("", 150, 80, 150, 20) $Label_IP = GuiCtrlCreateLabel("Ip Address", 40, 20, 100, 20) $Label_UN = GuiCtrlCreateLabel("UserName", 40, 50, 100, 20) $Label_PW = GuiCtrlCreateLabel("Password", 40, 80, 100, 20) $Button_4 = GuiCtrlCreateButton("Stop SmartSwitch Service", 150, 110, 150, 30) $Button_5 = GuiCtrlCreateButton("Start SmartSwitch Service", 150, 150, 150, 30) $StatusBar = GuiCtrlCreateLabel("", 62, 190, 296, 18, BitOr($SS_SIMPLE, $SS_SUNKEN)) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
Nuffilein805 Posted March 30, 2006 Share Posted March 30, 2006 what is the command for the psservice to start or stop the process while 1 ;... your code case $msg = $Button_4 run ("psservice.exe stop parameters") case $msg = $Button_5 run ("psservice.exe start parameters") ;... your code wend as i don't know the exact command i just did an example - you've got to add the right commands when you're finished plz post your code, i'd like to review it my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
markj Posted March 30, 2006 Author Share Posted March 30, 2006 the code will be along the lines of when stop smartswitch button is pressed it executes this command RunWait(@TempDir & "\psservice \\" & $Input_IP & " -u " & $Input_UN & " -p " & $Input_PW & " stop SmartSwitch", "", @SW_HIDE) how would this fit in? Link to comment Share on other sites More sharing options...
Nuffilein805 Posted March 30, 2006 Share Posted March 30, 2006 (edited) just replace my run-command with you runwait command this should do the job edit: don't forget to guictrlread("your gui-controls") or it won't work Edited March 30, 2006 by Nuffilein805 my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
markj Posted March 30, 2006 Author Share Posted March 30, 2006 would the guictrlread("my controls") come in the while command? Link to comment Share on other sites More sharing options...
Nuffilein805 Posted March 30, 2006 Share Posted March 30, 2006 no, in the runwait where you refer to you variable my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
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