I'm working on a script to pull 3 reg keys out and compare and replace them if necessary. The issue I'm having is getting the plane off the ground. I wanted to start by getting the script to read out a reg key but it is having issues.
so far I have this:
Option Explicit
Dim strComputer, strKeyPath, oReg, strValueName, strValue
const HKEY_CLASSES_ROOT = &H80000000
strKeyPath = "Excel.Sheet.8\shell\Open\command"
strValueName = 1
strComputer = "."
Set oReg=GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
WScript.Echo oReg.GetStringValue(HKEY_CLASSES_ROOT,strKeyPath,strValueName)
the reg key is the "default" so it has no name. This returns a 1 If I change the strValueName to "1" is returns a 161 it should return "C:\Program Files\Microsoft Office\Office12\EXCEL.EXE" /e "%1"
Please help!
so far I have this:
Option Explicit
Dim strComputer, strKeyPath, oReg, strValueName, strValue
const HKEY_CLASSES_ROOT = &H80000000
strKeyPath = "Excel.Sheet.8\shell\Open\command"
strValueName = 1
strComputer = "."
Set oReg=GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
WScript.Echo oReg.GetStringValue(HKEY_CLASSES_ROOT,strKeyPath,strValueName)
the reg key is the "default" so it has no name. This returns a 1 If I change the strValueName to "1" is returns a 161 it should return "C:\Program Files\Microsoft Office\Office12\EXCEL.EXE" /e "%1"
Please help!