(view source code of listica.bat as plain text)
@ECHO OFF
:: Check Windows version: NT 4 or later required
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
:: No command line arguments necessary
IF NOT "%~1"=="" GOTO Syntax
:: Enable delayed variable expansion
SETLOCAL ENABLEDELAYEDEXPANSION
:: Initialize variable
SET ica=
:: Store list of IP addresses in single environment variable
FOR /F "skip=4 tokens=*" %%A IN ('NSLOOKUP.EXE ica') DO SET ica=!ica! %%A
:: Check if any address was found
IF NOT DEFINED ica GOTO Syntax
:: Display a header -- cannot be redirected
> CON ECHO.
> CON ECHO IP addresses for ica:
> CON ECHO.
:: Display the resulting IP addresses -- can be redirected
(FOR %%A IN (%ica%) DO @ECHO. %%A) | SORT.EXE | FIND.EXE "."
:: Done
ENDLOCAL
GOTO:EOF
:Syntax
ECHO.
ECHO ListICA.bat, Version 1.00 for Windows NT 4 and later
ECHO List all IP addresses for Citrix' "ICA" DNS round robin alias
ECHO.
ECHO Usage: LISTICA
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
page last modified: 2024-04-16; loaded in 0.0058 seconds