reg add script to change SNMP sysLocation.

Posted on 2009-05-19
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 125 total points
ID: 24423420
not sure, have always used the regwrite method

Author Closing Comment

ID: 31583042
Thanks again!

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

696 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