khidotdn Posted December 14, 2015 Posted December 14, 2015 I would like to help on code check windows service , shown on the button. If it is disabled , the button serive out Enable and click Enable , then it displays Disable. Enable Service is also always . Thank you for your help
water Posted December 14, 2015 Posted December 14, 2015 Welcome to AutoIt and the forum!Can you please show us what you have tried so far? khidotdn 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Moderators JLogan3o13 Posted December 14, 2015 Moderators Posted December 14, 2015 @khidotdn, welcome to the forum. As water mentions, we try to adhere to the "teach a man to fish" motto. I do have the following snippet I use, however, that at least gets you started. You can change the $sService variable to the name of the service you're looking for.$wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $sService = "Application Identity" $oWMI = ObjGet("winmgmts:\\.\root\cimv2") $oItems = $oWMI.ExecQuery("SELECT * FROM Win32_Service", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($oItems) Then For $oService In $oItems If $oService.DisplayName = $sService Then ConsoleWrite($oService.DisplayName & " | " & $oService.StartMode & @CRLF) EndIf Next EndIfFrom here, I would suggest you take some time to read through the help file to create your GUI. Below is a simple framework that will get you started. I'll leave it to you to learn how to add your own button (look at GUICtrlCreateButton in the help file) and put the code together:#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 300, 300) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndOnce you have done some reading, and tried some things out on your own, feel free to post your code here if you run into issues. We will do our best to assist. khidotdn 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
khidotdn Posted December 16, 2015 Author Posted December 16, 2015 I just do Autoit apprentice , you can give me a code ? so I can study on that platform ? Thank you
Moderators JLogan3o13 Posted December 16, 2015 Moderators Posted December 16, 2015 @khidotdn, simply put - no. This forum is not a place where you put in a request and someone barfs up the code for you. You have been given more than enough to begin. How about you begin showing some effort? kylomas 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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