Computing.Net > Forums > Disk Operating System > Problem setting Variable with = in

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Problem setting Variable with = in

Reply to Message Icon

Name: dualpurpose
Date: September 28, 2003 at 21:08:54 Pacific
OS: Win98se
CPU/Ram: 900/384
Comment:

Hi...back again with another question!
I hope someone can help me with this...
My dilema is setting a variable to a string containing a "=" in this case "abcd=1234"
using the script below works on XP but not on Win98se....is there a way around this problem?

script:

echo e100'set %%1='> %temp%.\temp.bat
FOR %%? in (rcx 7 w q) do echo %%?>> %temp%.\temp.bat
TYPE %temp%.\temp.bat |DEBUG %temp%.\temp.bat > nul
FIND "abcd=1234" < FILE.TXT >> %temp%.\temp.bat
call %temp%.\temp.bat VAR1
del %temp%.\temp.bat

I'm sure the problem is Win98 setting a variable to a string containing "="
I've used a script posted by secret_doom using assembly within a batch to edit the string first but again if the ORIGINAL= a "=" it wont work....
Please help!



Sponsored Link
Ads by Google

Response Number 1
Name: anenefan
Date: October 12, 2003 at 07:45:01 Pacific
Reply:

Hi
I haven't done any scripting in win 98 but in win 98 virtual dos

find "abcd=1234" file.ext >a.dat
find "abcd=1234" <file.ext>>a.dat
find "abcd=1234" <file.ext> > a.dat

same result

no problem with the command it would seem, however use double quotation marks if the desired string contains a quotation mark.


0

Response Number 2
Name: dualpurpose
Date: October 13, 2003 at 12:54:11 Pacific
Reply:

Hi Anenefan

The problem is not with FIND but with setting a variable to the result of FIND

On XP SET VAR1=abcd=1234 works OK

On Win98 SET VAR1=abcd=1234 Does not work at all the result echoed on VAR1 is Echo is off or on whichever!

The same script in my first post will work with any STRING provided there is not an = within it....I'm looking for a way around this under WIN98

thanks

dual


0

Response Number 3
Name: anenefan
Date: October 14, 2003 at 00:43:24 Pacific
Reply:

Hi
Oh sorry I had missed that, I looked at the scripting quickly and looked for a command with the = sign.

They are work arounds inputting a true string in as a value, but will require downloading a better set command, which is ok if you want it to work only on your machine. In dos including 98, some symbols > | < = included as part of the string will cause an error. (does not copy the whole string as intended.)



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Transforming parameter in... Help:Firewire through PCM...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Problem setting Variable with = in

Setting a variable with the content www.computing.net/answers/dos/setting-a-variable-with-the-content/14848.html

set var command in batch file www.computing.net/answers/dos/set-var-command-in-batch-file/11416.html

Frustrated With Batch -- Set= www.computing.net/answers/dos/frustrated-with-batch-set/4804.html