Solved

Need a script to modify the registry

Posted on 2011-03-07
1
274 Views
Last Modified: 2012-05-11
Hi,

I need a script to create the below value for the following key: HKEY_LOCAL_MACHINE\SOFTWARE\CITRIX\RADE

value: AppHubWhitelist
Type: REG_SZ

and also add the following to the Registry Value:

<server name>;<Server IP>


Thank you
0
Comment
Question by:Icarious
1 Comment
 
LVL 3

Accepted Solution

by:
RussPitcher earned 500 total points
ID: 35056255
The simplest option is to use the REG utility (already available in Windows) with a simple batch file.

REG ADD HKLM\SOFTWARE\CITRIX\RADE /v AppHubWhitelist /t REG_SZ /d "<server name>;<Server IP>"

If you're after the local servername and IPaddress then use the attached batch file
@echo off

REM Quick clean up from any previous attempts
del %temp%\IP.txt /f /q
set TEMPSTRING=

REM Get the local IP addresses and place them in a file
ipconfig | find "IP Address" > %temp%\IP.txt

REM Parse the file and extract the IP address
for /f "tokens=2 delims=:" %%i in ('type %temp%\IP.txt') DO call :add %%i

REM Run REG.exe to add the registry value
REG ADD HKLM\SOFTWARE\CITRIX\RADE /v AppHubWhitelist /t REG_SZ /d "%COMPUTERNAME%%TEMPSTRING%"

REM Clean up after ourselves
del %temp%\IP.txt /f /q
set TEMPSTRING=
goto :EOF

:add
set TEMPSTRING=%TEMPSTRING%;%1

:EOF
REM That's All!

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now