Question : Creating a vbscript for registry key - IRPStackSize

Hi, I need to deploy a new registry key to approximately 100 devices on our domain.  Rather use a batch to call a .reg file I would like to create a vbscript logon script that checks if the key and value is there and if it is not, create it.  I am new to vbscripts and need some assistance.  Please can you assist me in creating it.

The key is as follows:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]
"IRPStackSize"=dword:00000021

Answer : Creating a vbscript for registry key - IRPStackSize

Ooops.. made a mistake, thats what happens when you copy from old code I wrote :P

Try this
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Services\lanmanserver\parameters"
strVal = "IRPStackSize"

oreg.getdwordvalue HKEY_LOCAL_MACHINE,strKeyPath,strVal,dwValue
if isnull(dwValue) then 
	oReg.SetDwordValue HKEY_LOCAL_MACHINE,strKeyPath,strVal,33
Else
	WScript.Echo dwvalue 
	If dwvalue <> 33 Then oReg.SetDwordValue HKEY_LOCAL_MACHINE,strKeyPath,strVal,33
End If
Random Solutions  
 
programming4us programming4us