|
发表于 2009-6-19 21:56:28
|
显示全部楼层
How do I configure the task bar settings (clock, small icons, autohide) as part of a POLICY?
-----------------------
Response:
These settings are part of a WINDOWS "STATE" that DOESN'T get written to the registry
UNTIL LOGOFF. The taskbar properties are stored in:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects\Settings
<<<
The page provides example .reg values, and DOES provide them as REGEDIT4 (win98) versions, so we can fairly assume that the info is applicable to Win9x. Unfortunately, neither of the examples show the settings for "Auto Hide".
After doing some browsing, and selectively dismissing all references to "Lock the Taskbar" only available in Windows XP, I discovered this page:
>>>
Windows Start Menu options are controlled by the following Registry locations.
Windows 2000 and XP use the 9th binary value and Windows NT uses the 53 binary value as shown in the table below.
Windows 2000 and XP
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2
"Settings"
SINGLE OPTIONS:
---------------
08 = No Settings Enabled
09 = Auto Hide
00 = Show Clock
0A = Always on Top
0C = Show small icons in Start Menu
MULTIPLE OPTIONS:
-----------------
01 = Auto Hide and Show Clock
02 = Always on Top and Show Clock
03 = Always on Top and Auto Hide and Show Clock
04 = Show small icons in Start Menu and Show Clock
0E = Always on Top and Show small icons in Start Menu
0F = Always on Top and Auto Hide and Show small icons in Start Menu
06 = Always on Top and Show small icons in Start Menu and Show Clock
07 = All Options Enabled
0B = Always on Top and Auto Hide
0D = Auto Hide and Show small icons in Start Menu
<<<
So, what it DOESN'T detail is precicely which of the hex values effect the changes detailed in the tables for Windows 9x.
Here's MY StuckRects "settings" value:
"Settings"=hex:28,00,00,00,ff,ff,ff,ff,06,00,00,00,03,00,00,00,3e,00,00,00,1e,\
00,00,00,fe,ff,ff,ff,3c,02,00,00,22,03,00,00,5a,02,00,00
Look at the 9th hexadecimal pair from the left ie. 06, and compare it to the table they give.
06 = Always on Top and Show small icons in Start Menu and Show Clock
Yes, those do reflect my current START MENU and taskbar settings.
Exporting that key once again after setting the Task Bar to "Auto Hide" (yes, I remembered to shift the desktop icons out the way first :-) Must do a desktop cleanup so I can see the wallpaper!!
"Settings"=hex:28,00,00,00,ff,ff,ff,ff,06,00,00,00,03,00,00,00,3e,00,00,00,1e,\
00,00,00,fe,ff,ff,ff,3c,02,00,00,22,03,00,00,5a,02,00,00
No change to that registry key, but I haven't rebooted with the Taskbar on AutoHide yet. Here goes!!!
"Settings"=hex:28,00,00,00,ff,ff,ff,ff,07,00,00,00,03,00,00,00,3e,00,00,00,1e,\
00,00,00,fe,ff,ff,ff,3c,02,00,00,22,03,00,00,5a,02,00,00
Immediately I notice that the 9th hex pair has changed to 07 - "All Options Enabled".
It all seems pretty obvious in retrospect, but that's precicely what has happened on MY system, ie. I have checked all 4 available boxes!!!
So, how can we set these changes without rebooting? I have often used a method of simulating a reboot which writes changes to the registry, and have done so while installing programs with several steps that need to be done one after the other with a reboot in between. I was using a CD-Burning Application and needed to install several updates, where each had the pre-requisite that the previous update be applied first or it wouldn't recognise it as a valid upgrade path.
CTRL + ALT + DEL shows Task List.
Highlight "Explorer" and click on "End Task"
If the Shutdown screen shows, click "Cancel"
Shortly after this an error message will show
Click on "End Task"
Windows explorer will be reloaded along with any new registry settings.
Another method, which would automate the registry change and reboot, would be to use the following example batch file from within Windows:
@echo off
start /w regedit /s C:\RegFiles\HideTaskBar.REG
C:\WINDOWS\RUNDLL32.EXE shell32,SHExitWindowsEx 2
EXIT
The /w (wait) switch is essential to force the process to wait until the registry import is finished.
"HideTaskBar.REG" would obviously contain the setting you have exported to suit YOUR required setting, and the above batch file assumes it to be in the folder C:\RegFiles.
I'm quite sure that there would be some elegant way of doing this by writing a Visual Basic Script (*.vbs) and then using the Windows Script Host (C:\Windows\WScript.exe) with the appropriate parameters to to run it, but that's where my knowledge ceases. |
|