[VBS SCRIPT] Klok weergeven in system tray

Pagina: 1
Acties:
  • 1.965 views sinds 30-01-2008
  • Reageer

  • mvdb1982
  • Registratie: April 2003
  • Laatst online: 17-03 21:51
Beste tweakers...

Gebruik op onze terminal server een script wat de taakbalk repareerd. Dit werkt prima.

Tevens wil ik er het volgende in verwerken:

code:
1
2
3
4
5
6
7
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: HideClock
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = Show Clock, 1 = Hide Clock)


Met bovenstaande register instellingen moet het mogelijk zijn de klok wel of niet weer te geven.
In het register wordt dit wel aangepast, maar de klok wordt nog steeds niet weergegeven.

In de Groupspolicy is de taakbalk verder niet geconfigureerd.

Iemand een idee?

PS: Gebruik onderstaande script:

Visual Basic:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
'TERMINAL SERVER TASKBAR REPAIR

Set WSHShell = WScript.CreateObject("WScript.Shell")

On Error Resume Next

'UNLOCK THE TASKBAR
P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\"
WshShell.RegWrite p1 & "TaskbarSizeMove", 1, "REG_DWORD"

WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2\"
WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU\"
WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop\"

WshShell.RegDelete "HKCU\Software\Microsoft\Internet Explorer\Explorer  Bars\{32683183-48a0-441b-a342-7c2a440a9478}\BarSize"

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"

WshShell.RegWrite p1 & "NoBandCustomize", 0, "REG_DWORD"
WshShell.RegWrite p1 & "NoMovingBands", 0, "REG_DWORD"
WshShell.RegWrite p1 & "NoCloseDragDropBands", 0, "REG_DWORD"
WshShell.RegWrite p1 & "NoSetTaskbar", 0, "REG_DWORD"
WshShell.RegWrite p1 & "NoToolbarsOnTaskbar", 0, "REG_DWORD"
WshShell.RegWrite p1 & "NoSaveSettings", 0, "REG_DWORD"
WshShell.RegWrite p1 & "NoToolbarsOnTaskbar", 0, "REG_DWORD"
WshShell.RegWrite p1 & "NoSetTaskbar", 0, "REG_DWORD"
WshShell.RegWrite p1 & "ClassicShell", 0, "REG_DWORD"

p1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\LocalUser\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"

WshShell.RegWrite p1 & "NoCloseDragDropBands", 0, "REG_DWORD"
WshShell.RegDelete p1 & "NoMovingBands"

p1 = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell"

WshShell.RegWrite p1, "explorer.exe", "REG_SZ"

'LOCK THE TASKBAR
p1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\"
WshShell.RegWrite p1 & "TaskbarSizeMove", 0, "REG_DWORD"

p1 = "HKCU\Software\Microsoft\Internet Explorer\Explorer Bars\{32683183-48a0-441b-a342-7c2a440a9478}\"
WshShell.RegDelete p1 & "BarSize"
WshShell.RegWrite p1, "Media Band", "REG_SZ"

On Error Goto 0

For Each Process in GetObject("winmgmts:"). _
    ExecQuery ("select * from Win32_Process where name='explorer.exe'")
   Process.terminate(0)
Next

[ Voor 60% gewijzigd door een moderator op 22-05-2007 11:49 . Reden: Het is [code] en niet <code> ;) ]


  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Kan het zijn dat je explorer.exe 1 keer moet killen en opnieuw opstarten om die klok zichbaar te maken?

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • NLChris
  • Registratie: Juli 2004
  • Laatst online: 21:30
Ik denk dat je moet rebooten of explorer.exe moet killen en restarten. Als de registry key goed is :)

edit: snelle mods :*)

Edit2:

Blijkbaar heb je die functionaliteit nog niet ingebouwd, maar ik zie niet in wat het probleem is, je hebt zelf regels voorbeeldcode?

Visual Basic:
1
2
P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\" 
WshShell.RegWrite p1 & "HideClock", 0, "REG_DWORD" 

[ Voor 65% gewijzigd door NLChris op 22-05-2007 12:03 ]


  • mvdb1982
  • Registratie: April 2003
  • Laatst online: 17-03 21:51
Dat wordt ook uitgevoerd:

code:
1
2
3
For Each Process in GetObject("winmgmts:"). _
ExecQuery ("select * from Win32_Process where name='explorer.exe'")
Process.terminate(0)

[ Voor 3% gewijzigd door mvdb1982 op 22-05-2007 11:51 ]


  • mvdb1982
  • Registratie: April 2003
  • Laatst online: 17-03 21:51
NLChris schreef op dinsdag 22 mei 2007 @ 11:46:
Ik denk dat je moet rebooten of explorer.exe moet killen en restarten. Als de registry key goed is :)

edit: snelle mods :*)

Edit2:

Blijkbaar heb je die functionaliteit nog niet ingebouwd, maar ik zie niet in wat het probleem is, je hebt zelf regels voorbeeldcode?

Visual Basic:
1
2
P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\" 
WshShell.RegWrite p1 & "HideClock", 0, "REG_DWORD" 
Heb bovenstaande code getest, maar helaas geen klok :)

  • NLChris
  • Registratie: Juli 2004
  • Laatst online: 21:30
Ik denk dat er wat anders aan de hand is want ik kan met gewoon de klok aan en uit zetten op die manier

  • mvdb1982
  • Registratie: April 2003
  • Laatst online: 17-03 21:51
NLChris schreef op dinsdag 22 mei 2007 @ 12:35:
Ik denk dat er wat anders aan de hand is want ik kan met gewoon de klok aan en uit zetten op die manier
Dat denk ik ook, maar wat :)

Heb op een andere (test) terminal server getest, maar ook hier hetzelfde probleem.

  • mvdb1982
  • Registratie: April 2003
  • Laatst online: 17-03 21:51
Ook op een andere terminal server werkt het niet...
Iemand nog een idee? Eventueel met een ander script?

  • mvdb1982
  • Registratie: April 2003
  • Laatst online: 17-03 21:51
Ok, ik ben eruit. Zie: http://ts.veranoest.net/ts_faq.htm#enable_clock


How can I enable the clock in the Taskbar for all remote sessions?
Before you go ahead and enable the clock, be sure to read this article, which explains why it might not be such a good idea after all:
186505 - Terminal Server Client Taskbar Clock Not Enabled
There's a GPO setting:

User configuration - Administrative templates - Start Menu and Taskbar
"Remove Clock from the system notification area"

but disabling this setting will not force the clock to display in the system tray, it will only allow users to enable the clock if they have access to the system tray on the Terminal Server. And in most situations, they haven't. To force the display of the clock in the taskbar, you will need to modify a setting in the registry. Start regedit and go to

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2

You'll see a "Settings" value, which contains something like this:
28 00 00 00 ff ff ff ff 02 00 00 00 03 00 00 00 6d 00 00 00 20 00 00 00 00 00 00 00 e0 03 00 00 00 05 00 00 00 04 00 00

The nineth pair of digits determines the Taskbar properties. Possible values are:
Always on top = 0x02
Auto hide = 0x01
Show small icons in Start menu = 0x04
Hide clock = 0x08

Combine the properties you want and set the byte. For example:
Always on top + Show small icons + Show clock = 06
Always on top + Show small icons + Hide clock = 0e

Note that the changes do not take effect immediately, you have to restart Explorer, or logoff and logon again to see the changes.

If you want to set this for all users, you'll have to export the registry key into a .reg file and import it into the user profile in a logon script. Start the logon script in your GPO to make sure that it runs (and imports the registry file) before Explorer is started.

Na het herstarten van de explorer werkt het meteen.

Bedankt voor jullie reacties...
Pagina: 1