Hi,
I am writing a simple DOS script to add a number of URL's into the registy in incremental values. The user will define the URL as
SET URL0=sitename
The issue is that when I loop around, I want to add 5 sites, I cannot get the variable to set correctly, I am using
SET "SITEURL=%URL%%SITETOADD%", but I want this to SET the details held in the variable URLX (ie the site)
Can someone offer me some help ?
Code snippet is posted below (obvously some variables are defined further up the code) ... please forgive the less than elegant scripting
SET SITENUMBER=%COUNT%
SET SITETOADD=0
SET NUMBEROFSITESTOADD=5
SET URL0=acas.org.uk
SET URL1=google.co.uk
SET URL2=bbc.co.uk
:_ADD1SITE
IF %NUMBEROFSITESTOADD%==0 GOTO _END
SET "SITEURL=URL%SITETOADD%"
SET "SITEADD=%LOCATION% %VALUE%%SITENUMBER% %LOCATION2% %SITEURL%"
REG ADD %SITEADD%
SET /a SITENUMBER+=1
SET /a NUMBEROFSITESTOADD-=1
GOTO _ADD1SITE
Struggling with variables
Moderator: DosItHelp
-
- Posts: 3
- Joined: 24 Feb 2010 05:24
Re: Struggling with variables
Can anyone help me with this .... ?
Re: Struggling with variables
Try this line:
CALL SET "SITEURL=%%URL%SITETOADD%%%"
Regards
aGerman
CALL SET "SITEURL=%%URL%SITETOADD%%%"
Regards
aGerman
-
- Posts: 3
- Joined: 24 Feb 2010 05:24
Re: Struggling with variables
aGerman - Wonderfull -- that worked a treat!
Many thanks --- much appreciated.
Many thanks --- much appreciated.