[FWTools] FWTools on USB

Matt Wilkie matt.wilkie at gov.yk.ca
Fri Feb 16 18:26:56 EST 2007


David Fawcett wrote:
> Has anyone come up with an example setfw.bat and openev.bat for use on a 
> USB drive where the drive letter may change? 

Save this attachment as "setfw_portable.cmd" and put in the root fwtools 
directory. The .cmd extension ensures that cmd.exe is used instead of 
command.com (which is a hold over from Win9x). The script will only work 
on Windows 2000 and newer.


cheers,

-matt
-------------- next part --------------
@echo off
if not %cmdextversion% GEQ 2 goto :WrongCmd

:Main
	cls &	echo.
	rem Root fwtools home dir to the same directory this script exists in
	set fwtools_dir=%~dp0
	echo FWTools home is %FWTOOLS_DIR% & echo.
	
	rem Add fwtools bin directory to path and make sure gdal is there.
	for %%a in (gdalinfo.exe) do (
		if [%%~dp$PATH:a]==[] path=%fwtools_dir%bin;%path%
		) 
	gdalinfo --version || goto :NotFound

	rem List available commands
	echo. & echo Available exe commands are: & echo.
	dir /d bin\*.exe |find ".exe"
	echo. & echo Available python commands are: & echo.
	dir /d bin\*.py |find ".py"

	goto :EOF

:WrongCmd
	echo.
	echo	Sorry, this script requires CMD.exe with extension
	echo	version 2 or above (Windows 2000 or later)
	echo.
	echo	Yours appears to be: %CMDEXTVERSION%
	echo.
	goto :EOF

:NotFound
	echo.
	echo	Sorry, I can't find GDAL Utilities
	echo.


More information about the FWTools mailing list