Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Properties of Start Menu through VB Script?

Status
Not open for further replies.

tyrant1969

Programmer
Dec 13, 2004
68
0
0
US
Is it possible to have a VBScript open the properties of the Start Menu, select the "start menu" tab and then select a specific Start Menu visual style (IE XP Start Menu or Classic Start menu)?
 
No, but what you can do is identify which registry keys set that property and then script setting the registry. Use a program like regsnap to take before and after snapshots of the registry.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Actually, I was able to find a method to do just this.

The following code will pull-up the properties of the Start button, change to the "Start Menu" tab, select the appropriate Menu style (Classic or XP), Apply it, and then exit.

Code:
Set Shell = CreateObject("Shell.Application")
Shell.TrayProperties [COLOR=red]'Opens the properties of the Start Button, to the taskbar tab[/color]
Set WshShell = CreateObject("WScript.Shell")
WScript.Sleep 100
WshShell.SendKeys "+{TAB}"  [COLOR=red]'Shift Tab to backup to the Taskbar tab[/color]
WScript.Sleep 100
WshShell.SendKeys "{RIGHT}" [COLOR=red]'Change to the Start Menu Tab[/color]
WScript.Sleep 100
WshShell.SendKeys "%S"  [COLOR=red]'Alt-S - selects the XP Start Menu[/color]
WshShell.SendKeys "%M"  [COLOR=red]'Alt-M - selects the Classic Start Menu (alternate option)[/color]
WScript.Sleep 100
WshShell.SendKeys "%A" [COLOR=red]'Alt-A - applies the settings[/color]
WScript.Sleep 100
WshShell.SendKeys "{ESC}" [COLOR=red]'Closes the window.[/color]
WScript.Sleep 100

Set Shell = Nothing
Set WshShell = Nothing

The only issue I've got at present is that if I have a quick user (oxymoron I realize) they can change the window focus and circumvent the script from running properly. Right now I'm searching for something that will allow a VBScript to disable Mouse/Keyboard input temporarily.
 
At a minimum you should always use AppActivate when using sendkeys.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top