Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Where have all the Command Line Warriors Gone?

If anyone can shed some light on a couple questions that are in part .NET related - I would be grateful. I am working on a CSharp WinForm project that will be doing some multi-threaded diagnostic processes from the command shell (cmd.exe). Accordingly, I will be executing window shell scripts like batch and command files.

1. Can someone explain the unique difference or characteristics between a batch file (*.bat) and a command file (*.cmd). Is thier advantages to using one over the other?

2. Can a .Net Console Project extend the functionality of cmd.exe or inherit the functionality of windows DOS.

Thanks for your help
[652 byte] By [smcneill] at [2007-11-11 8:37:03]
# 1 Re: Where have all the Command Line Warriors Gone?
1) Win9x can't handle CMD files. Beyond that, I don't think there is any difference. I have never run into one... and I did a quick Google search and didn't find anything right off.

2) I haven't a clue... :)
edburdo at 2007-11-11 21:47:09 >
# 2 Re: Where have all the Command Line Warriors Gone?
2. Can a .Net Console Project extend the functionality of cmd.exe or inherit the functionality of windows DOS.

A bit of reaching here...

But couldn't you simply create console programs that are placed into a directory in the path. That would effectively "extend the functionality of cmd.exe" with whatever executable programs you added......
Brad Jones at 2007-11-11 21:48:09 >
# 3 Re: Where have all the Command Line Warriors Gone?
Interesting point... I'm not sure it would work in my case. Basically what I am doing is developing a little windows app that would give you the ability to store different configurations for launching java apps... Kind of like the run tool in eclipse. The difference being that this would not carry the foot print that eclipse carries. It will also minimize to the tray and won't clutter up your desktop w/command windows when developing or debuging. In away, you could look at it as a mini win service console that monitors the console output so you can see it if you like.

Anyway, I have been experimenting with just calling the ever popular batch files that so many java servers use to start them in a windows environment. Problem is -- It is a little difficult to monitor the state of the app. I'm thinking I need a Java2Com bridge and possibly look into executing java myself and not relying on bat files -- or maybe make it optional.
smcneill at 2007-11-11 21:49:12 >