Running legacy batch files
Running legacy batch files
I have several batch files from my windows installation that I've been using for many years, and I wonder what's the best way to transfer them to a Linux machine, without having to rewrite them as shell scripts.
Some of these batch files call DOS programs and some call Win32 console programs. Unfortunately I have a few that has calls to both a DOS and a Win32 console program.
The problem is:
1) The DOS programs won't run in Wine, and
2) The Win32 console programs won't run in DOSBox/DOSEmu/etc.
I am looking for a single environment that will run both Win32 console and DOS executables, and which can interpret DOS/Windows batch files.
Any help is appreciated.
Some of these batch files call DOS programs and some call Win32 console programs. Unfortunately I have a few that has calls to both a DOS and a Win32 console program.
The problem is:
1) The DOS programs won't run in Wine, and
2) The Win32 console programs won't run in DOSBox/DOSEmu/etc.
I am looking for a single environment that will run both Win32 console and DOS executables, and which can interpret DOS/Windows batch files.
Any help is appreciated.
Re: Running legacy batch files
Rewrite them in any real scripting language (shell, perl).Bamm wrote:I have several batch files from my windows installation that I've been using for many years, and I wonder what's the best way to transfer them to a Linux machine
Re: Running legacy batch files
Since my original questions starts with "without having to rewrite them as shell scripts" and you replied with "Rewrite them in any real scripting language (shell, perl)." then I must conclude that there is no way to run my DOS/Windows batch files in Linux then? Is this correct? Either that, or you you missed the part of my original post where I said I wanted to run the file as is rather than port it to a scripting language?vitamin wrote:Rewrite them in any real scripting language (shell, perl).Bamm wrote:I have several batch files from my windows installation that I've been using for many years, and I wonder what's the best way to transfer them to a Linux machine, without having to rewrite them as shell scripts.
Wine does have a cmd that can run some. But big but Bamm
http://tldp.org/LDP/abs/html/dosbatch.html << Rewrite is normally better. Bat is a massively messy language.
Then there is the evil of the dual format bat bash file.
http://blog.bigsmoke.us/2007/06/11/micr ... hellscript
There are even better ways of doing that.
The following is incorrect.
Still does not change the fact of course. What dos programs what windows programs. Do they have *nix replacement. Converted scripts will work on all processors if they have *nix replacements including inside some nokia phones. Also script will most likely work back on windows threw one means or another. cygwin, andlinux ,openlina.... List goes on.
http://tldp.org/LDP/abs/html/dosbatch.html << Rewrite is normally better. Bat is a massively messy language.
Then there is the evil of the dual format bat bash file.
http://blog.bigsmoke.us/2007/06/11/micr ... hellscript
There are even better ways of doing that.
The following is incorrect.
http://www.japheth.de/HX.html HX extender for dos.The Win32 console programs won't run in DOSBox/DOSEmu/etc
Still does not change the fact of course. What dos programs what windows programs. Do they have *nix replacement. Converted scripts will work on all processors if they have *nix replacements including inside some nokia phones. Also script will most likely work back on windows threw one means or another. cygwin, andlinux ,openlina.... List goes on.
Running legacy batch files
On Sun, Jun 8, 2008 at 7:48 PM, Bamm <[email protected]> wrote:
Use wine cmd.exevitamin wrote:Since my original questions starts with "without having to rewrite them as shell scripts" and you replied with "Rewrite them in any real scripting language (shell, perl)." then I must conclude that there is no way to run my DOS/Windows batch files in Linux then? Is this correct? Either that, or you you missed the part of my original post where I said I wanted to run the file as is rather than port it to a scripting language?Bamm wrote:Rewrite them in any real scripting language (shell, perl).I have several batch files from my windows installation that I've been using for many years, and I wonder what's the best way to transfer them to a Linux machine, without having to rewrite them as shell scripts.
Interesting links! Thanks oiaohm! I'll be studying them.oiaohm wrote:Wine does have a cmd that can run some. But big but Bamm
http://tldp.org/LDP/abs/html/dosbatch.html << Rewrite is normally better. Bat is a massively messy language.
Then there is the evil of the dual format bat bash file.
http://blog.bigsmoke.us/2007/06/11/micr ... hellscript
There are even better ways of doing that.
The following is incorrect.http://www.japheth.de/HX.html HX extender for dos.The Win32 console programs won't run in DOSBox/DOSEmu/etc
Still does not change the fact of course. What dos programs what windows programs. Do they have *nix replacement. Converted scripts will work on all processors if they have *nix replacements including inside some nokia phones. Also script will most likely work back on windows threw one means or another. cygwin, andlinux ,openlina.... List goes on.

Re: Running legacy batch files
Btw, can a batch file be passed on as a command line argument to cmd.exe, or do I have to open cmd first and run the batch file from there?austin987 wrote:Use wine cmd.exe
Re: Running legacy batch files
wine cmd /c foo.batBamm wrote:Btw, can a batch file be passed on as a command line argument to cmd.exe, or do I have to open cmd first and run the batch file from there?austin987 wrote:Use wine cmd.exe
Re: Running legacy batch files
Thanks!jeffz wrote:wine cmd /c foo.bat