Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


reg add script to change SNMP sysLocation.

Posted on 2009-05-19
Medium Priority
Last Modified: 2013-11-05
I have a script to add snmp settings a group of servers that need to be monitored by HP SIM. The script work fine except I have been asked to add a different "Value Data" to the "sysLocation". The sysLocation string value is a default windows value wiht no entry for "value data". I need to change that using my reg add script.

I have tried to add the value, delete the value and recreate. It seems the  string is locked, the permissions are correct. I am just having issues with this one string.

Has anyone scripted the attribute change to this string? If so how? thanks ahead of time for the help.
objshell.Run "reg add \\" & strComputer & "\HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent\ /ve sysLocation /t REG_SZ /d XX-location-XX"

Open in new window

Question by:LouisvilleMetro
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 47

Expert Comment

by:Donald Stewart
ID: 24423121
Try below:
DIM Path,Location
WshShell.RegWrite  Path & "sysLocation",Location,"REG_SZ"
LVL 47

Expert Comment

by:Donald Stewart
ID: 24423176
More complete below:

DIM Path,Location,WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite  Path & "sysLocation",Location,"REG_SZ"

Author Comment

ID: 24423272
It changes the attribute! I am curious as to why the reg add will not change the value. Do you have any insight into this?

thanks again for your help.
LVL 47

Accepted Solution

Donald Stewart earned 500 total points
ID: 24423420
not sure, have always used the regwrite method

Author Closing Comment

ID: 31583042
Thanks again!

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a hurry?.. scroll down to "HERE's HOW TO DO IT" Section. Greetings All, I was going to post this as question/solution, but its seems more appropriate as an article considering its length.  I felt it important to illucidate all the details c…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question