Vbscript VBS如果注册表值存在,则运行某些操作

Vbscript VBS如果注册表值存在,则运行某些操作,vbscript,registry,windows-xp,Vbscript,Registry,Windows Xp,大家好,我想创建一个脚本,该脚本将查看windows xp的安装语言,然后根据注册表中列出的语言,它将执行一个命令并修改另一个位置的值 我已经让它工作了,但是当值等于字符串时,它就失败了。请参阅附件 当查找Finland 040B时,它会失败,如果使用 if (strvalue) = 040B Then hence i then switched to see if can read the full value of registry but still fails. 需要帮忙吗 我为19

大家好,我想创建一个脚本,该脚本将查看windows xp的安装语言,然后根据注册表中列出的语言,它将执行一个命令并修改另一个位置的值

我已经让它工作了,但是当值等于字符串时,它就失败了。请参阅附件

当查找Finland 040B时,它会失败,如果使用

if (strvalue) = 040B Then  hence i then switched to see if can read the full value of registry but still fails.
需要帮忙吗

我为19种语言运行这个,所以其他语言也是字符串格式的

RegKey= "InstallLanguage"
strKeyPath = "SYSTEM\ControlSet001\Control\Nls\Language"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,RegKey,strValue
'检查该值是否存在

'如果不是IsNull(strValue),则


如何从注册表中获取值?此外,如果没有这样的引号,就不能有字符串值。将其更改为:
if(strValue=“040B”)
Heya感谢Joe我正在阅读注册表常量HKEY\U LOCAL\U MACHINE=&H8000001
If (strValue) = 0407 Then
    objWSHShell.Run "c:\programdata\wmg\LyncMUI32.exe /passive /norestart"
    objRegistry.SetDWORDValue HKEY_CURRENT_USER, LyncKey, strLang, Ger
    Else 
    If (strValue) = 0804 Then ' chinese Simplifed
        objWSHShell.Run "c:\programdata\wmg\LyncMUI32.exe /passive /norestart"
        objRegistry.SetDWORDValue HKEY_CURRENT_USER, LyncKey, strLang, chismp
    Else 
    If (strValue) = 0404 Then ' chinese Traditional
        objWSHShell.Run "c:\programdata\wmg\LyncMUI32.exe /passive /norestart"
        objRegistry.SetDWORDValue HKEY_CURRENT_USER, LyncKey, strLang, ChiTrad
        Else 
        If (strValue) = 0406 Then ' danish
            objWSHShell.Run "c:\programdata\wmg\LyncMUI32.exe /passive /norestart"
            objRegistry.SetDWORDValue HKEY_CURRENT_USER, LyncKey, strLang, Dan
            Else 
            If (strValue) = 0413 Then ' dutch
                objWSHShell.Run "c:\programdata\wmg\LyncMUI32.exe /passive /norestart"
                objRegistry.SetDWORDValue HKEY_CURRENT_USER, LyncKey, strLang, Dtc
                Else 
                'strfinland = "040B"
                    if (strValue = 040B) Then
                    'If objRegistry.EnumValue(HKEY_LOCAL_MACHINE, "SYSTEM\ControlSet001\Control\Nls\Language", "InstallLanguage", strfinland) = 0 Then 'finnish
                        msgbox "Finland"
                        objWSHShell.Run "c:\programdata\wmg\LyncMUI32.exe /passive /norestart"
                        objRegistry.SetDWORDValue HKEY_CURRENT_USER, LyncKey, strLang, Fin
                        Else