Click to See Complete Forum and Search --> : Where have all the Command Line Warriors Gone?


smcneill
05-04-2006, 08:50 AM
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

edburdo
05-04-2006, 11:44 AM
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... :)

Brad Jones
05-04-2006, 02:08 PM
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.......

smcneill
05-04-2006, 02:24 PM
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.