<br><br><div class="gmail_quote">2010/2/1 Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
maven apache wrote:<br>
<br>
> I want to write a bat to starat grass in command line .<br>
><br>
> Thant's to say how to set the environment variables and grass vairables in<br>
> the bat file.<br>
><br>
> In fact I want to call garss in my java web application, so I think if I can<br>
> write a bat to start grass, then I can do the same job(set envrionment<br>
> variables) in my codes, then call garss.<br>
><br>
> Is there anyone who has same experience?<br>
<br>
</div></div>Try something like the following:<br>
<br>
set WINGISBASE=C:\GRASS-64-SVN<br>
set GISBASE=C:/GRASS-64-SVN<br>
set PATH=%WINGISBASE%/bin;%WINGISBASE%/lib;%PATH%<br>
set GRASS_MESSAGE_FORMAT=silent<br>
<br>
set GIS_LOCK=0<br>
set GRASS_VERSION=6.5.svn<br>
<br>
WD=...<br>
UNIQUE=...<br>
set GISRC=%WD%/gisrc_%UNIQUE%<br>
copy %WD%\grassrc6 %GISRC%<br>
<br>
rem create a new mapset for this session<br>
g.mapset -c mapset_%UNIQUE%<br></blockquote><div>This is my bat: <br></div><div>-----------------------<br><b>set WINGISBASE=F:\anzhuang\GRASS-6-SVN<br>set GISBASE=F:\anzhuang\GRASS-6-SVN<br>set PATH=%WINGISBASE%/bin;%WINGISBASE%/lib;%PATH%<br>
set GRASS_MESSAGE_FORMAT=silent<br><br>set GIS_LOCK=0<br>set GRASS_VERSION=6.5.svn<br><br>set WD=C:/Documents and Settings/Administrator<br><br>set GISRC=%WD%/grassrc6<br><br>rem create a new mapset for this session<br>g.mapset -c mapset_a</b><br>
----------------------- <br>I wonder the unique parameter is required or optional,however this bat does not work. It seems that some libraries are not added.<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
You will need to set WD to a working directory, and set UNIQUE to a<br>
unique value for each session (on Unix, $$ contains the PID of the<br>
shell process; you'll need to figure out something for Windows).<br>
<font color="#888888"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</font></blockquote></div><br>