Saturday snippet: Parsing a file from a batch file

From the 2014 version of setenv.bat, which uses the for command to parse the [new] License.env file.

for /f "delims== tokens=1,2*" %%i in (License.env) do (
		set SILicMethod=%%j
	) else if "%%i"=="ADSKFLEX_LICENSE_FILE" (
		set _ADSK_LicServers=%%j

License.env is a file that looks something like this:

rem Licensing method: Standalone | MSSA | Network

rem License servers specified from the setup. Format: [port1]@host1[;[port2]@host2]...

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s