schiu_ca
asked on
how to use VBScript to access a registry key that contains '/'
I am trying to get the version number of Rtvscan from the registry.
The key is located in the registry folder HKLM\Software\Intel\DLLUsa ge
The key is "C:\Program Files\Symantec AntiVirus\Rtvscan.exe"
I try to set up the registry path as "HKLM\Software\Intel\DLLUs age\VP6\C: \\Program Files\\Symantec AntiVirus\\Rtvscan.exe"
I got an error on the invalid registry key when the script is ran.
How do you quote "\" in the key?
The key is located in the registry folder HKLM\Software\Intel\DLLUsa
The key is "C:\Program Files\Symantec AntiVirus\Rtvscan.exe"
I try to set up the registry path as "HKLM\Software\Intel\DLLUs
I got an error on the invalid registry key when the script is ran.
How do you quote "\" in the key?
'
' Check registry for Antivirus version number
dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
'
REgPath = "HKLM\Software\Intel\DLLUsage\VP6\C:\\Program Files\\Symantec AntiVirus\\Rtvscan.exe"
'
val = "NULL"
val = objShell.RegRead(RegPath)
' WScript.Echo val
ipos = InStr(1, val, "10.1.6010")
If ipos > 0 Then
Call objShell.Run("cmd /c Echo .. > C:\Temp\VP6.flg")
End If
VBErr.bmp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah, yes, I forgot that bit. Thanks for the grade.
Regards,
Rob.
Regards,
Rob.
ASKER
The script worked great. I just needed to declare objshell at line 12.
Set objShell = WScript.CreateObject("WScr
Thanks