Thursday, April 25, 2013

Read Registry from Local or remote Machine

'to read HKEY Local Machine registry

const HKEY_LOCAL_MACHINE = &H80000002

'prompt for the machine name to input for scanning, the in front part is the prompt and behind one is for Title

strComputer = ""

Set oReg=GetObject( _

   "winmgmts:{impersonationLevel=impersonate}!\\" &_

    strComputer & "\root\default:StdRegProv")

'registry path

strKeyPath = "software\citi\agent"

'registry Value Name

strValueName = "redirect"

'value that it is going to read

oReg.getstringvalue _

   HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

'show with msgbox for the result

MsgBox (strComputer &" CITI agent Status is " & strValue)

Related Posts:

  • Check file exist Here is how to check for file exist while we copy to or from machine’s data Example below show the checking of CMD.exe in Windows\system32 folder… Read More
  • Pause / WaitUsing sleep function to pause your program Wscript.Echo "Time Start" 'here is the most important line WScript.sleep 6000 Wscript.Echo "6 Second … Read More
  • Wait command Sometime we want the script to run a little bit slower than the time we executed them. Here is the command to wait for 6 sec Wscript.Echo "Ti… Read More
  • Read Registry from Local or remote Machine'to read HKEY Local Machine registryconst HKEY_LOCAL_MACHINE = &H80000002'prompt for the machine name to input for scanning, the in front part is … Read More
  • To show "POP UP" to inform userWScript.Echo("This is a pop up")… Read More

0 comments:

Post a Comment