Sunday, October 30, 2005

"Run DOS Commands from .NET with Free msDOScommand Class"

Run DOS Commands from .NET with Free msDOScommand Class | developer.* Blogs

"The msDOScommand class, written in Visual Basic.Net, executes MS-DOS commands and provides both status and results.

Features:
* A guarantee that results are complete as a string from each of one or more MS-DOS commands. This is provided by terminating each MS-DOS command in a submitted batch with a dummy file create command. The existence of the dummy file (which is erased by default) proves when tested by msDOScommand that your prior commands executed...avoiding the very dangerous phenomenon of random failures in MS-DOS calls.

* Full thread safety which means that while one instance CANNOT issue more than one command for competing execution, you can access the Status property of this class while waiting for an MS-DOS job, and perform other work while waiting for the command.

You can download the msDOSCommand code here (2MB zip file).

...

...the class removes the VB programmer from having to code asynchronous calls to shell() to run MS-DOS commands.

The software as available comes with a comprehensive test form and application for Windows/.Net which allows you to create an msDOScommand instance, inspect it, test it, and so forth.

...

I do ask that msDOScommand be used ethically. It has no special code for preventing evil commands such as creation of unknown cookies or erasing files. Since you will have the source you can consider adding these safeguards."


Sounds kind of cool. Like it or not, sometimes you just need those old crusty DOS commands...

No comments: