<> wrote in message
news:e354cdd9-22f5-4049-85d3-...
> It's a lot easier to do this in a WSH script, but since you seem
> comfortable in batch try this hybrid script ...
>
> @echo off
> echo wsh.echo Replace(wsh.stdin.readall, "\", vbnewline) > %temp%
> \tmp.vbs
> cscript //nologo %temp%\tmp.vbs < myfile.txt > outfile.txt
> del %temp%\tmp.vbs
>
> HTH,
>
> Tom Lavedas
> ***********http://there.is.no.more/tglbatch/- Hide quoted text -
>
> - Show quoted text -
I'm not opposed to using WSH...I just don't know WSH. This wsh script
providded doesn't appear to get me what I need...this spits out my
text in a different formatted text file, which isn't what I'm looking
for.
===> Your only stated requirement was to "perform a set of actions on each
of these values individually". Tom illustrated one example, leaving the
specific details up to you to code according to the specs you had not yet
shared.
My ultimate goal is to query a registry key, which lists GUID values
of other registry keys and then take this list of GUIDs and translate
these into "friendly" names. I'm querying a key in the registy for the
"Contains" value, which lists several GUIDs...Here's my script:
rem HKLM\Software\Company\Group\GUID\Contains REG_MULTI_SZ GUID1 GUID2
GUID3..
for /f "tokens=3 skip=2 delims=\ " %%i in ('reg query HKLM\Software
\Company\Group\GUID /v Contains') do set guidlist=%%i
for /f "tokens=2* skip=1" %%a in ('reg query HKLM\Software\Company\
%guidlist% /v Name') do set friendlyname=%%b
for /f "tokens=2* skip=1" %%c in ('reg query HKLM\Software\Company\
%guidlist% /v Version') do set version=%%d
echo %frienlyname% %version%
This works fine collecting the first GUID value in this group, but I
can't figure out how to loop this to call the other 100+ values in
this "Contains" key. I figured I'd try writing these GUIDs out to a
temp file and then loop thru this file, but I'm getting the same
result...only calls the first value in the file and won't loop to the
2nd+ value.
===> Here is another partial solution, but I hope it will help you
successfully get around the FOR command token limits:
@echo off
setlocal enabledelayedexpansion
pushd "%~DP0"
rem get the list of "/"-delimited items from a file into a variable...
for /f %%X in (ZZ.TXT) do (set _zz=%%X)
rem convert the "/" delimiters to blank characters
(set _zz=%_zz:/= %)
rem pass the list of items to an internal subroutine
call

rocess %_zz%
pause & goto:eof

rocess
set/a _c = 0

rocessloop
if "%1" NEQ "" (
set/a _c += 1
echo/processing item !_c!: %1
shift
goto

rocessloop
)
goto:eof
The zz.txt file contains a single line with text strings separated by "/"
characters. In my test this file was about 5800 bytes in size and contained
455 items, and each was displayed accurately.
/Al