WMI JScript doesn't work.

G

Guest

when i run below JScript codes, nothing works. I mean there is no error
message or result or anything.

what can i do to fix this code.? thanks

//=============
/*
'************************************************
' Description: Detecting Delete.vbs from Windows Run Registry
'
' Author: Andy
'
'last update: 11/28/05
'************************************************
*/

var HKEY_LOCAL_MACHINE = 0x80000002;

var strComputer = ".";
var oReg=GetObject("winmgmts:\\\\" + strComputer +
"\\root\\default:StdRegProv");

var sPath2 = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
var sName= new Array();
var iType = new Array();
var sValue;

oReg.EnumValues(HKEY_LOCAL_MACHINE, sPath2, sName, iType);

var ok=new Enumerator(sName);
for(;!ok.atEnd();ok.moveNext())
{
var s=ok.item();
oReg.GetStringValue(HKEY_LOCAL_MACHINE,sPath2,s,sValue);
WScript.echo("========================");
WScript.echo( s +" : "+ sValue) ;
}
 
G

Guest

i can't believe that I answer my own question here without anybody's help.

i will post a solution to this problem later on
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top