You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jonathan Levinson <Jo...@intersystems.com> on 2011/12/05 20:39:20 UTC

RE: Why do you use .cmd rather than .bat?

Hi Simon,

I tested the following fop.cmd file on Windows 7 and it works.  It may lack support for some earlier Windows versions, such as Windows 98.  I copy fop-dev so my little command file can be subjected to contributor review:

Here are the contents of fop.cmd.  The Apache script had tests for %OS%=Windows_NT, which is true on Windows 7.  I don't have a non-NT Windows system on which to test the script, so I removed those tests, such as " if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME=%~dp0".  I won't put in code I can't test.

----- beginning of script fop.cmd ---------------------
@ECHO OFF
set LOCAL_FOP_HOME=%~dp0
set FOP_CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set FOP_CMD_LINE_ARGS=%FOP_CMD_LINE_ARGS% %1
shift
goto setupArgs
rem This label provides a place for the argument list loop to break out 
:doneStart

call %LOCAL_FOP_HOME%\fop.bat %FOP_CMD_LINE_ARGS%

----------------- end of script ----

Best Regards,
Jonathan Levinson
Senior Software Developer
Object Group
InterSystems
+1 617-621-0600
jonathan.levinson@intersystems.com


> -----Original Message-----
> From: Simon Pepping [mailto:spepping@leverkruid.eu]
> Sent: Monday, December 05, 2011 1:53 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Why do you use .cmd rather than .bat?
> 
> To avoid code duplication, is it possible to have fop.cmd say something like 'call
> fop.bat'? Can you test that? I have no computer with Windows available.
> 
> Or vice versa. Which is the canonical name, bat or cmd?
> 
> Simon
> 
> On Sun, Dec 04, 2011 at 04:17:37PM -0500, Jonathan Levinson wrote:
> > A copy named fop.bat would be very useful to us.
> >
> > We currently have most sites deployed on fop 1.0, which names the command
> script on Windows as fop.bat.  For Skynav fop, for our Middle Eastern sites, we
> are contemplating (after suitable QA) replacing fop 1.0 with Skynav fop.
> However, some of these sites will be on versions of our product which do
> assume the name of the script on Windows is fop.bat.  While, we can tell users
> to rename fop.cmd to fop.bat, it will simplify configuration if fop ships with a
> fop.bat.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org