Hello all.

I have a problem with a command in the Run Before Distribution script.

The script is:
set SERVICE-NAME=my_service
set SERVICE-PORT=123456/tcp
set SERVICE-FILE=%SYSTEMROOT%\system32\drivers\etc\services
set FOUND-IT=false
for /F "eol=# tokens=1,2*" %%i in (%SERVICE-FILE%) do if /i "%%i" EQU
if /i "%FOUND-IT%" EQU "false" @echo %SERVICE-NAME% %SERVICE-PORT% >>

Script Engine Location: cmd.exe /c
Extension for script file: .bat
Zen version:

Its' purpose is to add a service entry to the local workstation's services
file if it is not already present.

The problem line is the "for..." command.

I've tried simplifying the for command in above script: (also doesn't work)
for /F "eol=# tokens=1,2*" %%i in (%SERVICE-FILE%) do set > c:\temp\test.txt

The script works fine when run as a batch file.

I've thought of using the text editor part of the distribution, however, the
syntax of the service entry is not consistent across all our workstations (>
500 PC's). Some use spaces, some use tabs, some use spaces and tabs. The
text editor only works on "exact matches", so this won't help me.

Any help would be greatly appreciated.