0

我试图用一些 WSH 弄湿我的脚。我以为这很容易,但这真的是一场噩梦……

registry.js 的内容 >

Set shell = WScript.CreateObject('WScript.Shell');
strRegValue = 'HKLM/Software/Microsoft/Windows/CurrentVersion/ProductID';    
strPID = shell.RegRead(strRegValue);    
WScript.Echo strPID;

这是读取注册表值的代码片段。也许你能看出它有什么问题,因为我肯定看不到!

4

1 回答 1

2

如何尝试这种方式:

var shell = WScript.CreateObject('WScript.Shell');
// my version of windows does not have the regkey you initially specified
strRegValue = 'HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\CommonFilesDir';    
strPID = shell.RegRead(strRegValue);    
WScript.Echo(strPID);
于 2009-12-01T22:35:34.513 回答