Sign in to follow this  
Followers 0
DougR

Script to automate MSCONFIG

4 posts in this topic

Hi all,

I am looking to find a script that will do a simple task. I need to open MSCONFIG and configure a few things automatically. Here they are:

Open Msconfig.exe

Navigate to the 3rd tab (services)

Check the "hide all microsoft services" button

click "disable all"

Navigate to the 4th tab (startup)

click "disable all"

click OK to close the box.

Seems like a very simple task to do. Does anyone know of a script that is already written to do this, or where I can find one? I really cand do a screen recording, because of the differences in screen resolutions.

Thanks!

Share this post


Link to post
Share on other sites



find the control handles to the buttons and tabs

Like this:

#include <GuiTab.au3>
;

Run("msconfig.exe")
WinWait("System Configuration")
Sleep(500)
$hSysConfig = WinGetHandle("System Configuration")
$hTab = ControlGetHandle($hSysConfig, "", "SysTabControl321")


;Click services
_GUICtrlTab_ClickTab($hTab, 2)
Sleep(50)

;Check the hide
ControlCommand($hSysConfig, "", "Button3", "Check")
Sleep(50)

;Disable all
ControlClick($hSysConfig, "", "Button2")
Sleep(50)

;Click startup
_GUICtrlTab_ClickTab($hTab, 3)
Sleep(50)

;Disable all
ControlClick($hSysConfig, "", "Button2")
Sleep(50)

; Apply
ControlClick($hSysConfig, "", "Button22")
Sleep(50)

Share this post


Link to post
Share on other sites

Thanks, Szhlopp!

I am a total noob at autoit, and this was just what I needed. From your script, I was able to add code to make it click "ok" after clicking apply. Thanks again!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0