DaveCummings
Posts: 26
Joined: Tue May 29, 2012 8:26 pm
Location: Liverpool UK
Contact: Website

Running DOS Batch Files

Fri May 18, 2018 10:31 am

Hello All,
I am sure this has been asked before, but would like to run a batch file against a CSV file. The first few lines are:

Code: Select all

prompt %p$g
CLS
DCARS Radar Processing.
=======================
STAGE 1
-------
ECHO.
Assigning Aircraft Registrations to HEX/MODES codes.
This may take some time....
rem copy d:\processor\incoming\*.csv d:\processor\backups\
process -r -i "d:\processor\incoming\*.csv" "EC-402" "EC-402,Airbus Military,A400M,,Airbus Military,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-404" "EC-404,Airbus Military,A400M,,Airbus Military,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-CCE" "EC-CCE,Cessna,414,,Private,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-CGV" "EC-CGV,Piper,PA-28 180 Cherokee,,Private,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-CHE" "EC-CHE,Beech,King Air A100,,Secretariat of Civil Aviation,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-CJF" "EC-CJF,Cessna,337G Super Skymaster,,Private,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-CSQ" "EC-CSQ,Piper,PA-28R 200 Cherokee Arrow II,,Private,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-CZV" "EC-CZV,Aerotek,Pitts Special S-2A,,Private,,,Yes"
process -r -i "d:\processor\incoming\*.csv" "EC-CZZ" "EC-CZZ,Reims/Cessna,FR172J Rocket,,Private,,,Yes"
Can anyone advise if this would be possible?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 19568
Joined: Sat Jul 30, 2011 7:41 pm

Re: Running DOS Batch Files

Fri May 18, 2018 10:38 am

Looks like that script is calling a program called "process" which is probably the bit that is going to be difficult to replicate under Linux (rewriting the script in bash would probably be fairly easy). Have you got a Linux version of it? Or know what it does?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

n67
Posts: 690
Joined: Mon Oct 30, 2017 4:55 pm

Re: Running DOS Batch Files

Fri May 18, 2018 10:42 am

jamesh wrote:
Fri May 18, 2018 10:38 am
Looks like that script is calling a program called "process" which is probably the bit that is going to be difficult to replicate under Linux (rewriting the script in bash would probably be fairly easy). Have you got a Linux version of it? Or know what it does?
Yeah, my first reaction on seeing this thread was the usual "Oh, you can't run a batch file under LInux, etc, etc, etc:", but then I noticed that this was posted in the Windows 10 for IOT section, so it really has nothing to do with Linux.

I, of course, know nothing about Windows 10 for IOT, but I would guess that there is probably some kind of support for DOS batch files there. If not, then one may have to convert it to PowerShell, which is the latest/current version of the DOS batch language.
"L'enfer, c'est les autres"

DaveCummings
Posts: 26
Joined: Tue May 29, 2012 8:26 pm
Location: Liverpool UK
Contact: Website

Re: Running DOS Batch Files

Fri May 18, 2018 10:48 am

REPLACE is actually a program called FART :
http://www.majorgeeks.com/files/details/fart.html

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 19568
Joined: Sat Jul 30, 2011 7:41 pm

Re: Running DOS Batch Files

Fri May 18, 2018 12:27 pm

DaveCummings wrote:
Fri May 18, 2018 10:48 am
REPLACE is actually a program called FART :
http://www.majorgeeks.com/files/details/fart.html
So could be replaced by grep and sed I suspect.

If that is majority of the work, then you could easily rewrite the batch file to run under Linux. I cannot comment on using it under Win10IoT, I know nothing.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
fruitoftheloom
Posts: 16599
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK

Re: Running DOS Batch Files

Fri May 18, 2018 1:32 pm

DaveCummings wrote:
Fri May 18, 2018 10:48 am
REPLACE is actually a program called FART :
http://www.majorgeeks.com/files/details/fart.html

This will not run in Windows 10 IoT Core OS, you need a x86 Windows Desktop OS !
""understanding the theoretical, but not always the end goal""

My other Devices are the ChromeBit CS10, ChromeCast & Huawei Mate 10 Pro SmartPhone

n67
Posts: 690
Joined: Mon Oct 30, 2017 4:55 pm

Re: Running DOS Batch Files

Fri May 18, 2018 2:07 pm

I don't get all these references to either "REPLACE" or "F***", since neither appear in the original posted batch file (*). What exactly ARE we talking about anyway?

Also, REPLACE is an old-school DOS command (and presumably still present in WIN 10), not that that has any relevance to this either.

(*) The batch file seems to be repeated calls to something called "process" - whatever that is.
"L'enfer, c'est les autres"

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 19568
Joined: Sat Jul 30, 2011 7:41 pm

Re: Running DOS Batch Files

Fri May 18, 2018 2:37 pm

n67 wrote:
Fri May 18, 2018 2:07 pm
I don't get all these references to either "REPLACE" or "F***", since neither appear in the original posted batch file (*). What exactly ARE we talking about anyway?

Also, REPLACE is an old-school DOS command (and presumably still present in WIN 10), not that that has any relevance to this either.

(*) The batch file seems to be repeated calls to something called "process" - whatever that is.
Good point. I brought up the "process" command in my first post, but then someone decided to chime in with replace and sidetracked everything.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
Z80 Refugee
Posts: 175
Joined: Sun Feb 09, 2014 1:53 pm

Re: Running DOS Batch Files

Sat May 19, 2018 8:05 am

At first glance, it looks like the "process" command takes parameters which specify character string replacements in a file. These things can be accomplished easily in Linux.
Military and Automotive Electronics Design Engineer (retired)

Return to “Windows 10 for IoT”

Who is online

Users browsing this forum: No registered users and 1 guest