Running legacy batch files

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Running legacy batch files

Post by Bamm »

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.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Running legacy batch files

Post by vitamin »

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
Rewrite them in any real scripting language (shell, perl).
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Re: Running legacy batch files

Post by Bamm »

vitamin wrote:
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.
Rewrite them in any real scripting language (shell, perl).
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?
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Post by oiaohm »

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.
The Win32 console programs won't run in DOSBox/DOSEmu/etc
http://www.japheth.de/HX.html HX extender for dos.

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.
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Running legacy batch files

Post by austin987 »

On Sun, Jun 8, 2008 at 7:48 PM, Bamm <[email protected]> wrote:
vitamin wrote:
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.
Rewrite them in any real scripting language (shell, perl).
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?





Use wine cmd.exe
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Post by Bamm »

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.
The Win32 console programs won't run in DOSBox/DOSEmu/etc
http://www.japheth.de/HX.html HX extender for dos.

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.
Interesting links! Thanks oiaohm! I'll be studying them. :)
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Re: Running legacy batch files

Post by Bamm »

austin987 wrote:Use wine cmd.exe
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?
jeffz
Level 5
Level 5
Posts: 345
Joined: Thu Mar 13, 2008 10:03 pm

Re: Running legacy batch files

Post by jeffz »

Bamm wrote:
austin987 wrote:Use wine cmd.exe
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?
wine cmd /c foo.bat
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Re: Running legacy batch files

Post by Bamm »

jeffz wrote:wine cmd /c foo.bat
Thanks!
Locked