Sign in to follow this  
Followers 0
krclark

Automating Windows Tweaks

15 posts in this topic

First things first... I build computers (about 1/month) for friends and family as a way to get some extra money.

One of the things I like to do for them is change windows settings and such using tweaks I have collected over the past couple of years. Doing this manually can take longer than building the system and installing all of the programs. What I want is to automate most of the things I do for the system setup.

So far I have been able to figure out how to do all of the registry tweaks, and a few of the setup items for specific programs.

What I need help with is figuring out how to access "Display Properties" and "System Properties".

I need "Display Properties" to be able to set ClearType fonts active for systems that will be using an LCD Monitor.

I need "System Properties" to change to location and size of Virtual Memory. (I always create a seperate partition for this and for all of the temporary file stuff).

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites



yeah very much suggested. i use these myself. go searching for rundll.exe

examples

Date/time applet, Time Zone tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,@0,1

Desktop applet, Screensaver tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,1

Network applet, Protocols tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL,@0,2

Network applet, Adapters tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL,@0,3

System applet, Environment tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL SYSDM.CPL,@0,2


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

Thanks!

This is exactly what I needed. If you don't mind my asking, how did you know all of those locations?

After finding the powercfg.cpl info on another post I did a search on my system for *.cpl files yesterday, hoping to get lucky finding what I needed.

I got nothing. Zip, Zero, Zilch...

Share this post


Link to post
Share on other sites

goto find in start men and type in the extension cpl

you will find alot of things. ohh by the way i mess with alternate windows shells. so i have gotten used to doing alot of back dooring in windows..


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

One more question regarding this...

What do the numbers following he @ symbold signify?

I noticed that without including that part the Desk.cpl would come up on the first tab, but after including it the window would open on the third tab. I tried changing each of the numbers(one at a time) by +/-1. I was hoping to see the tab come up one more to the left or right for some of these, but got no change...

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,1

RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,2

RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,3

RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,4

they deal with the tabs on that opened control panel applet..

the above is just an example, each will take you to a different tab on the same applet.

keep this in mind if your gonna run one right after another remmber to close the applet first before you try the next one following.

Edited by beerman

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

I tried using different numbers to select different tabs (like you listed), but they kept coming up with the same tab no matter what number was used.

Anyway, I got the ClearType setting to work using the follwoing:

Run("RUNDLL32 SHELL32.DLL,Control_RunDLL Desk.cpl,@0,1")

Sleep(1500)

ControlCommand("Display Properties", "", "SysTabControl321",

"TabRight", "")

Sleep(500)

ControlClick("Display Properties", "", "&Effects...")

Sleep(500)

ControlCommand("Effects", "", "U&se the following method to

smooth edges of screen fonts:", "Check", "")

Sleep(500)

ControlCommand("Effects", "", "ComboBox2", "

SetCurrentSelection", "1")

Sleep(500)

ControlClick("Effects", "", "Button7")

Sleep(500)

ControlClick("Display Properties", "", "Button3")

My only concern is, what if a different tab comes up on a different computer...

I will play around with the numbers again, see if the problem is unique to my laptop or if I get the same results on my other computers too.

Thanks again for your help. Now I have something to keep me busy tommorrow!

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I recommend browsing VirtualPlastic.net for pages like this one

This code might also help. However, the "While Not StringInStr" loop could fail (especially on < 300 MHz computers) if the tab takes a long time to appear. To be more robust, you should check that WinGetText() does not return identical values twice in a row...

$WinName = "Display Properties"
$TabName = "Screen Saver"

Run("RUNDLL32 SHELL32.DLL,Control_RunDLL Desk.cpl")
WinWaitActive($winName)

While Not StringInStr( WinGetText($winName), $TabName)
   ControlCommand($winName,"","SysTabControl321","TabRight","")
   sleep(500);this delay increases reliability
WEnd

Exit


; Snippet that helps open a tab when you know its number
;  BUT the dialog opens with the previously open tab instead of
;  the very first tab

$t = ControlCommand("Example foo","","SysTabControl321","CurrentTab","")
If $t < 6 Then
   While $t <> 6
      $t = $t + 1
      ControlCommand("Example foo","","SysTabControl321","TabRight","")
   Wend
Else
   While $t <> 6
      $t = $t - 1
      ControlCommand("Properties for","","SysTabControl321","TabLeft","")
   Wend
EndIf
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Some of this stuff can probably be set through the registry with some poking about. It will probably require a restart/logoff to make the changes take effect, but I believe that all the display settings (Clear type, animations, et cetera) are stored in the registry. Also, changing those registry settings and calling EnvUpdate() may cause some to change.

You'll need to do some poking about the web to find the registry settings, though, I don't know them off the top of my head.

Share this post


Link to post
Share on other sites

Valik brings up a good point. I use the program RegShot to track down registy keys.

1) Run RegShot to take 1st snapshot

2) Perform some tweak

3) Run RegShot to take 2nd shot

4) Click the compare button

I believe some settings--especially printer and display adapter settings under the HKEY_CURRENT_CONFIG (hive?)--have a different location on every computer, so you'd probablyl need to use an "unstable" AutoIt build that has the newly added "RegEnumKey" function.

Finally, search for command-line versions of tools that can change such settings. They can be FileInclude'd with your script.


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

not needed, after you know what key to change jsut make a script to change them...

RegShot -> knowlegde -> Script -> Automation LOL

Share this post


Link to post
Share on other sites

This is great. woo hoo. You probably know them all but I thought i would list my findings

the one with the @ are ones that for some reason don't support it and the ones with the @ have a number on the far side that how many different options there are.

Hope it help someone

Add hardware wizard

RUNDLL32 SHELL32.DLL,Control_RunDLL hdwwiz.cpl

Intel® 82865G Graphics Controller Properties

RUNDLL32 SHELL32.DLL,Control_RunDLL igfxcpl.cpl

Internet Properties

RUNDLL32 SHELL32.DLL,Control_RunDLL inetcpl.cpl,@0,0 6

Regional and Language Options

RUNDLL32 SHELL32.DLL,Control_RunDLL intl.cpl,@0,0 2

Game Controlers

RUNDLL32 SHELL32.DLL,Control_RunDLL joy.cpl

Mouse Properties

RUNDLL32 SHELL32.DLL,Control_RunDLL main.cpl,@0,0 4

Sounds and Audio Devices Properties

RUNDLL32 SHELL32.DLL,Control_RunDLL mmsys.cpl,@0,0 4

Network applet, Protocols tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL

User Accounts

RUNDLL32 SHELL32.DLL,Control_RunDLL nusrmgr.cpl

Accessibility options

RUNDLL32 SHELL32.DLL,Control_RunDLL access.cpl,@0,1 5

Add and remove programs

RUNDLL32 SHELL32.DLL,Control_RunDLL appwiz.cpl,@0,0 4

Desktop applet, Screensaver tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,1 3

ODBC32

RUNDLL32 SHELL32.DLL,Control_RunDLL odbccp32.cpl

Power Options Properties

RUNDLL32 SHELL32.DLL,Control_RunDLL powercfg.cpl

Intel® ProSet II

RUNDLL32 SHELL32.DLL,Control_RunDLL PROSetp.cpl

System applet, Environment tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL SYSDM.CPL,@0,0 5

Phone and Modem Options

RUNDLL32 SHELL32.DLL,Control_RunDLL telephon.cpl,@0,0 2

Date/time applet, Time Zone tab:

RUNDLL32 SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,@0,1 2

Speech properties

C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.cpl

Share this post


Link to post
Share on other sites

This is all great information.

I will try the regshot out as soon as I can, but I did not see anything in the registry that seemed to key into the ClearType settings when I did a manual search.

Oh, just FYI:

I tried changing the numbers for the desk.cpl settings. All of the numbers work properly for the different tabs except for the Appearance Tab.

This one should be 0,4 but the numbers just bring up the Screen Saver Tab (0,3). It is not just limited to my laptop either. The problem occurs on all 3 of the desktops I have as well.

Share this post


Link to post
Share on other sites

Some stuff can be found here (Including font smoothing):

HKEY_CURRENT_USER\Control Panel\Desktop

Share this post


Link to post
Share on other sites

Add hardware wizard

RUNDLL32 SHELL32.DLL,Control_RunDLL hdwwiz.cpl

That really helped me out! Thank you guys for such a nice program and all your info on it :)

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