我们公司有一些用户需要使用额外的键盘,以实现其他pipe理员写的VBS脚本,当某个用户在一个特定的组login到机器时运行VBS脚本(这被设置为GPO应用于这些用户)。
最近有些用户join了这个组织,他们需要其他语言的键盘,所以我在脚本中增加了一些额外的字段。 新的脚本似乎在从未有过这种键盘设置的机器上工作正常,但对于那些有人用旧的键盘脚本login的机器,由该脚本设置的键盘仍然强制执行,没有额外的键盘似乎被应用到新机器上。
这是我正在尝试使用的脚本:
Dim WshShell Set WshShell = WScript.CreateObject("WScript.Shell") 'Portugese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\2", "00000816", "REG_SZ" 'Japanese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\3", "00000411", "REG_SZ" 'Japanese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\4", "e0010411", "REG_SZ" 'Chinese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\5", "00000804", "REG_SZ" 'Chinese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\6", "e00e0804", "REG_SZ" 'Arabic Libya WshShell.RegWrite "HKCU\Keyboard Layout\Preload\7", "0000040c", "REG_SZ" 'German WshShell.RegWrite "HKCU\Keyboard Layout\Preload\8", "00000407", "REG_SZ" 'Swedish WshShell.RegWrite "HKCU\Keyboard Layout\Preload\9", "0000041d", "REG_SZ" 'Spanish WshShell.RegWrite "HKCU\Keyboard Layout\Preload\10", "0000040a", "REG_SZ" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\ShowStatus", 0, "REG_DWORD" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\ExtraIconsOnMinimized ", 1, "REG_DWORD" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\Label", 1, "REG_DWORD" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\Transparency", 0, "REG_DWORD"
如果我在不显示语言栏中显示新键盘的机器上查看registry编辑器,并进入HKEY_USERS,则.DEFAULT具有仅显示默认英国键盘的键盘布局。 但是,当我把一个用户login到机器上时,一个新的条目出现在底部的HKEY_USERS中,并列出了出现在语言栏上的3个键盘(而不是之后添加到VBS中的其他键盘)。 我已经尝试编辑这个条目的string,这没有任何影响,在重新启动后,我所做的更改消失(我必须从我的机器使用registry编辑器,因为用户没有能力得到这些设置)。
我也尝试添加一个额外的键盘的.DEFAULT用户密钥,这并不帮助重新启动后。
有没有办法让机器忘记已经应用的所有键盘设置,以便下次有人login时使用这个脚本中定义的键盘设置? 或者脚本中是否有某些东西可以让机器忘记旧的设置?
目前,我相信唯一可行的方法就是重新安装机器,这可能是矫枉过正的问题,当有20台机器需要这种修复,未来还可能要求更多的键盘时,这可能是矫枉过正的问题。
任何帮助感激!
我结束了在那里改变了几个选项,并最终与此:
Dim WshShell Set WshShell = WScript.CreateObject("WScript.Shell") 'German WshShell.RegWrite "HKCU\Keyboard Layout\Preload\2", "00000407", "REG_SZ" 'Japanese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\3", "00000411", "REG_SZ" 'Chinese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\4", "00000404", "REG_SZ" 'Swedish WshShell.RegWrite "HKCU\Keyboard Layout\Preload\5", "0000041d", "REG_SZ" 'Spanish WshShell.RegWrite "HKCU\Keyboard Layout\Preload\6", "0000040a", "REG_SZ" 'Portugese WshShell.RegWrite "HKCU\Keyboard Layout\Preload\7", "00000816", "REG_SZ" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\ShowStatus", 4, "REG_DWORD" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\ExtraIconsOnMinimized", 1, "REG_DWORD" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\Label", 1, "REG_DWORD" WshShell.RegWrite "HKCU\Software\Microsoft\CTF\LangBar\Transparency", ff, "REG_DWORD"