[osgeo4w-dev] So does this mean the old non-networked versions will die?

Joanne Cook j.cook at oxfordarch.co.uk
Thu Jun 26 04:17:58 EDT 2008


Yup,

That's the magic key to portable gis. Find drive letters, replace with %~dp0. Works for all versions of windows, even Vista. Darn, my secret's out...

Jo

-----------------------------------------------------
Joanne Cook
Senior IT Support and Development
Oxford Archaeology (North)
01524 880212
http://thehumanjourney.net

----- Original Message -----
From: "Matt Wilkie" <matt.wilkie at gov.yk.ca>
To: "Frank Warmerdam" <warmerdam at pobox.com>
Cc: "Joanne Cook" <j.cook at oxfordarch.co.uk>, osgeo4w-dev at lists.osgeo.org
Sent: 25 June 2008 22:15:44 o'clock (GMT) Europe/London
Subject: Re: [osgeo4w-dev] So does this mean the old non-networked versions will die?

I believe it works for NT and newer, certainly windows 2000 and newer.

%0	= name of current batch file
%~d0	= Drive letter of    "
%~p0	= path of            "
%~dp0	= drive and path of  "

Full explanation at http://www.ss64.com/ntsyntax/parameters.html


matt wilkie
--------------------------------------------
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------


Frank Warmerdam wrote:
> Matt Wilkie wrote:
>>> Do you have a pointer to notes on how you setup Portable GIS?   I've
>>> only paid passing attention to your efforts so far, but I'd like to
>>> ensure you can provide something similar based on OSGeo4W.
>>
>> For gdal utilities I think it's as simple as replacing "set 
>> OSGEO4W_ROOT=C:\OSGeo4W" in osgeo4w.bat with:
>>
>> -----------------
>> rem Root OSGEO4W home dir to the same directory this script exists in
>> set OSGEO4W_ROOT=%~dp0
>> rem Remove trailing backslash
>> set OSGEO4W_ROOT=%OSGEO4W_ROOT:~0,-1%
>> echo OSGEO4W home is %OSGEO4W_ROOT% & echo.
>> -----------------
> 
> Matt,
> 
> Wow, how does all this "%~dp0" and related stuff work?  Does this work on
> any NT or newer cmd.exe shell?   Is there a web page or help file or 
> something
> I could look at?
> 
> Best regards,





------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.



More information about the osgeo4w-dev mailing list