5
我想獲取註冊表路徑的所有值,包括其子文件夾的值。現在,我通過這個讀取一個文件夾的值:通過註冊表子文件夾迭代
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
msgbox subkey ' Just for debugging
Next
這個偉大的工程,但除了我需要得到該文件夾的子文件夾列表。
我希望得到一個結果(只有內容是很重要的,而不是格式,無需將其寫入文件)之類的,這將命令給我:
regedit /e c:\testfile.reg
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
是有辦法在vbs中執行此操作,或者是否需要使用Wscript.Shell調用從Windows中使用regedit命令。
這工作得很好,THX –