Solved

Need a script to modify the registry

Posted on 2011-03-07
1
278 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Security cameras working but files saving are corrupt 4 151
Move XP PC to Vmware 22 145
Vb script to unzip a files and rename the files 5 95
read an xml file in perl 2 49
Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
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…

808 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