Hi Jonathan, With recent Windows (Vista), IIUC there is no difference between .cmd and .bat; the engine remains the same in both cases: cmd.exe
In the past, Win 9x family (and before) used only .bat, witch was threated with command.com The engine cmd.exe was introduced with NT family. On XP machines, it seems that both cmd.exe and command.com coexist, and invoking the former or the latter depends on ext. So there are some differences of available commands and behaviors between .cmd and .bat on such machines HTH, Le 05/12/2011 20:49, Jonathan Levinson a écrit : > Outlook mangled my script on send by removing what it thought were "extra > line breaks." > > I attach a zip of the script since our Exchange server won't let us send > ".cmd" files directly. > > Inside the zip is fop.cmd. You'll note is more than a "call fop.bat" yet > less than the entirety of "fop.bat" - it has to do something to pass the > arguments to fop.bat and also to determine what directory fop.bat exists in. > I assume fop.bat and fop.cmd are in the same directory. > > Best Regards, > Jonathan Levinson > Senior Software Developer > Object Group > InterSystems > +1 617-621-0600 > [email protected] > > >> -----Original Message----- >> From: Jonathan Levinson >> Sent: Monday, December 05, 2011 2:39 PM >> To: [email protected]; [email protected] >> Subject: 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 >> [email protected] >> >> >>> -----Original Message----- >>> From: Simon Pepping [mailto:[email protected]] >>> Sent: Monday, December 05, 2011 1:53 PM >>> To: [email protected] >>> 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. -- Pascal --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
