<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.developerdotstar.com/community" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>developer.* Blogs - Run DOS Commands from .NET with Free msDOScommand Class - Comments</title>
 <link>http://www.developerdotstar.com/community/node/280</link>
 <description>Comments for &quot;Run DOS Commands from .NET with Free msDOScommand Class&quot;</description>
 <language>en</language>
<item>
 <title>printing from DOS software to modern (non-dotmatrix) printers</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-4187</link>
 <description>&lt;p&gt;Can you help me find out how to print from DOS software to inkjet type modern printers rather than to just the old Epson compatible dot matrix type printers.  I have some DOS programs that I use a lot but would like to have the capability of obtaining the Epson fonting on the newer printers.&lt;/p&gt;
&lt;p&gt;Thank you for any information or help you can give me.&lt;/p&gt;
&lt;p&gt;Bernie Tonroy&lt;/p&gt;
</description>
 <pubDate>Thu, 01 Feb 2007 10:51:32 -0800</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 4187 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Are you using msdosCommand?</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-1579</link>
 <description>&lt;p&gt;That&#039;s the free software on this site which handles many of the problems, and comes with documentation about handling other problems.&lt;/p&gt;
&lt;p&gt;Here&#039;s what I think your problem may be...&lt;/p&gt;
&lt;p&gt;Just running shell() in a different thread is NOT the answer.&lt;/p&gt;
&lt;p&gt;This is because the new thread is accessing system files through the pseudo-DOS interface completely outside of .Net.&lt;/p&gt;
&lt;p&gt;Meanwhile, other .Net threads are doing the same thing.&lt;/p&gt;
&lt;p&gt;This creates collisions, possibly deadlocks.&lt;/p&gt;
&lt;p&gt;My software at least tries to address the problem that exists when you use a safe-appearing legacy library function like shell() in Visual Basic, which runs well under .Net, but contains &quot;gotchas&quot; both as regards internationalization and here, the system facilities that are issued when you issue a batch command through shell.&lt;/p&gt;
&lt;p&gt;The basic problem: when you issue any VB library command that violates thread safety, YOU are thread unsafe and YOUR program will &quot;seem to work&quot; at first, but then crash or hang, usually when you are proudly demonstrating your work to the boss from hell, who would like to fire you.&lt;/p&gt;
&lt;p&gt;shell() is completely thread unsafe because in the batch command, it can do ANYTHING. This is an instance of the paradox of computing &quot;power&quot;: you are empowered to mess up.&lt;/p&gt;
&lt;p&gt;Not only are other threads in your application constantly interacting with the Windows file system, other applications on your system are doing the same.&lt;/p&gt;
&lt;p&gt;msdosCommand cannot fully address all these problems. Instead, it provides a primitive framework in which to create the batch file and make sure it runs through to completion.&lt;/p&gt;
&lt;p&gt;The contents of the batch file can still be dangerous. They can erase the user&#039;s hard disk, for starters.&lt;/p&gt;
&lt;p&gt;It looks like you are doing it &quot;your&quot; way, therefore my advice is to do it &quot;my&quot; way.&lt;/p&gt;
&lt;p&gt;Download the msdosCommand software, read the documentation, drink the Kool Aid and use the class.&lt;/p&gt;
</description>
 <pubDate>Mon, 09 Oct 2006 22:50:53 -0700</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 1579 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>running dos command in vb.net</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-1577</link>
 <description>&lt;p&gt;hai Edward i have a doubt like i amtrying to run a batch file in vb.net but its not working ,created a new thread to run this (basically i was using Shell to do tht).Only for the application am running its not working but if i create a new application and try the same its working .any idea why it doesn&#039;t work in one and work in the other.Is it that  the main thread is restricting other threads not to function properly.after running the application it shows the dos screen but doesn&#039;t perform the function properly....please let me know if you have experienced anything similar&lt;br /&gt;
Regards&lt;br /&gt;
Thomas&lt;/p&gt;
</description>
 <pubDate>Mon, 09 Oct 2006 07:45:34 -0700</pubDate>
 <dc:creator>Thomas</dc:creator>
 <guid isPermaLink="false">comment 1577 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Ping away</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-1389</link>
 <description>&lt;p&gt;I wrote msdosCommand because &quot;they&quot; (the suits) expect us to monitor the network in a sort of perverted vigil, watching it all night long. This is silly. You should be able to issue pings and other commands from a monitor, go home and go to bed.&lt;/p&gt;
&lt;p&gt;When my wife was suffering from postpartum depression, I had to drag my butt down to Tulsa, Oklahoma, essentially to babysit a network so one suit could say to another that they had a passel of &quot;experts&quot; on the case.&lt;/p&gt;
&lt;p&gt;One has better things to do, and msdosCommand was written so you can do them safely, whence its timeout controls and so on.&lt;/p&gt;
&lt;p&gt;Check out Dan Read&#039;s discussion of error handling and don&#039;t stop learning new things.&lt;/p&gt;
</description>
 <pubDate>Wed, 16 Aug 2006 01:29:39 -0700</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 1389 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>msdosCommand</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-1387</link>
 <description>&lt;p&gt;Glad you found it. Sure you are not a programmer? I won&#039;t be working on new releases, probably, having a number of higher-priority projects to hand. But let me know if you have any specific comments or change requests.&lt;/p&gt;
</description>
 <pubDate>Tue, 15 Aug 2006 15:35:19 -0700</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 1387 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>New Version of msdoscommand vb.net</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-1386</link>
 <description>&lt;p&gt;Just curious as the comment dates are over a year old.  Will there ever be a &quot;new version&quot; or have you moved on to other things?&lt;/p&gt;
&lt;p&gt;Thank you for what you have done.  I am NOT a programmer.  I &quot;cut-n-paste&quot; together samples, examples, and freebies to make my .net code do what I need for monitoring my network.  None of it was possible before I found the msdoscommand class.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
</description>
 <pubDate>Tue, 15 Aug 2006 10:59:09 -0700</pubDate>
 <dc:creator>Kerry</dc:creator>
 <guid isPermaLink="false">comment 1386 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>vb.net help</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-1266</link>
 <description>&lt;p&gt;Hi sir,&lt;/p&gt;
&lt;p&gt;        how to run a ms dos batch work file in vb.net code. &lt;/p&gt;
&lt;p&gt;ex: if create a .txt fiel by using stream write how to give the print command in dos print. please help me sir.&lt;/p&gt;
&lt;p&gt;thanking you&lt;/p&gt;
</description>
 <pubDate>Fri, 14 Jul 2006 23:00:45 -0700</pubDate>
 <dc:creator>R.devaraj</dc:creator>
 <guid isPermaLink="false">comment 1266 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Converting msDOSCommand to Visual Basic Express</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-1163</link>
 <description>&lt;p&gt;msDOSCommand converts to Visual Basic Express easily. VB Express is a free VB.Net but unlike the older Learning editions, more full-featured.&lt;/p&gt;
&lt;p&gt;The VB Express compiler, when used to compile the source code of msDOSCommand as downloaded from Developer Dot Star, emits more than a hundred warnings and three errors.&lt;/p&gt;
&lt;p&gt;The warnings all have to do with local variables declared, mostly in utilities.vb, but not used, and local variables declared without explicit assignment of a starter value that are then used as reference parameters.&lt;/p&gt;
&lt;p&gt;I agree with Microsoft in the latter case that it is poor practice to declare a variable without assigning it and then pass it by reference. &lt;/p&gt;
&lt;p&gt;The errors are in one case statement in datatype_() in utilities where a case statement checks an object for number values, and, it is easily fixed: go to datatype_() and find Select Case objValue: change this to Select Case CType(objValue, integer).&lt;/p&gt;
</description>
 <pubDate>Sat, 03 Jun 2006 22:20:49 -0700</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 1163 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>New vers with asynch commands will NOT be available in a day or</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-612</link>
 <description>&lt;p&gt;so. I have gotten sidetracked with some deeper issues. &lt;/p&gt;
&lt;p&gt;I will endeavor in future to do a better job of making and keeping committments. My apologies if you were waiting for this new version.&lt;/p&gt;
&lt;p&gt;Consider changing the source code yourself if you need this feature.&lt;/p&gt;
&lt;p&gt;Again: my apologies.&lt;/p&gt;
</description>
 <pubDate>Wed, 09 Nov 2005 02:41:09 -0800</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 612 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Thanks, Steve!</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-601</link>
 <description>&lt;p&gt;Interesting point (that in XP you can redirect stderr). It confirms that MS-DOS still exists, exists in multiple versions, and is being evolved by a group of gnomes and elves at Microsoft.&lt;/p&gt;
&lt;p&gt;I see them in my mind&#039;s eye, happy and contented at having a secure job but in a corner of the lunchroom muttering darkly about what new features they can sneak in.&lt;/p&gt;
&lt;p&gt;Having a permanent job maintaining old software leading to a cozy retirement is for me the road not taken. I was maintaining a compiler but when I ran out of work like an idiot I looked for another job.&lt;/p&gt;
&lt;p&gt;I am working on a new version with a script language but this has diverted me into a Garden of Forking Paths in which I&#039;d like to follow up on some issues with the Build Your Own compiler, which will power the script language. I will incorporate stderr redirect.&lt;/p&gt;
&lt;p&gt;Great to hear that my code is useful as always.&lt;/p&gt;
</description>
 <pubDate>Mon, 31 Oct 2005 23:39:25 -0800</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 601 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Justa suggestion</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-599</link>
 <description>&lt;p&gt;I really like your work.  It is impressive.  I made a small change that helped me alot.  For example if the command was &quot;net&quot; with no options, the user would get nothing back.  It is helpful to get error message.  In windows XP you can redirect stderr, unlike previous other Windows OSes.   So I modified line 2433 to add the stderr redirection:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;
&lt;pre&gt;strCommands &amp;amp;= &amp;quot; &amp;gt; &amp;quot; &amp;amp; enquote(strOutputId) &amp;amp; &amp;quot; 2&amp;lt;&amp;amp;1&amp;quot;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I have not tested yet but it oughta work.  I will probably also add a conditional test to determine the OS so it only applies the 2&lt;/p&gt;
</description>
 <pubDate>Mon, 31 Oct 2005 18:03:50 -0800</pubDate>
 <dc:creator>Steve</dc:creator>
 <guid isPermaLink="false">comment 599 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Ethical considerations re msdosCommand</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-582</link>
 <description>&lt;p&gt;The current version can issue pathological commands, as I have said. Moreover, the version I am working on has the capability of behaving as did one of the first computer virus, the unix self-replicating virus that was created by Robert Tappan Morris of Cornell University in 1987.&lt;/p&gt;
&lt;p&gt;Now, the source code could itself undertake to scan commands for safety, and it could also limit the number of threads in the new version.&lt;/p&gt;
&lt;p&gt;But, this would be a misallocation of my time.&lt;/p&gt;
&lt;p&gt;This is because I would code the checks perforce as clearly as any other code, having a prior committment to transparency, therefore, the checks could be removed given that the source is distributed.&lt;/p&gt;
&lt;p&gt;The fact is that shell() already exists, and that Microsoft is responsible for the relative lack of security that is created by a failure to acknowledge, properly, the existence of MS-DOS (for example, one searches in vain for a BNF definition of a Windows file that is not violated with impunity by third parties that use &quot;invalid&quot; identifiers to encode and international software, and I had to devise a minimal BNF in fileFinder).&lt;/p&gt;
&lt;p&gt;Now, it SOUNDS pretty sleazy to say &quot;not my responsibility&quot;. But this is because the fashion today is Zero Tolerance and Personal Responsibility as a sort of pose. &lt;/p&gt;
&lt;p&gt;Again: all this code allows you to do is issue shell() safely. It merely replicates some features already available in .Net shell but in a more transparent and OO fashion.&lt;/p&gt;
</description>
 <pubDate>Tue, 25 Oct 2005 01:27:57 -0700</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 582 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>New version will be available in a day or so</title>
 <link>http://www.developerdotstar.com/community/node/280#comment-581</link>
 <description>&lt;p&gt;I am working on a new version of this code. It allows the user to prefix any MS-DOS command with a semicolon. The effect is that the command is issued with no wait as is the default behavior.&lt;/p&gt;
&lt;p&gt;If a semicolon precedes any command in the Command batch of 0..n newline-separated MS-DOS commands, then that command is used to create a new instance of the msdosCommand class running a new thread, running the doCommand() method already available.&lt;/p&gt;
&lt;p&gt;I added this because in an MS-DOS command script, I wanted to serenade myself with the French and the Dutch national anthems, which involved calling Windows Media Player as a command line. There is no need to &quot;wait&quot; because of course WMP creates a Windows application.&lt;/p&gt;
&lt;p&gt;Of course, the true destination is an msdosCommand class which supports a Turing-complete programming language in its Command script, but this awaits some further work on the fileFinder for finding frigging files in the f*d up environment of Windows!&lt;/p&gt;
&lt;p&gt;I will upload the new version of msdosCommand in a day or so with semicolon-prefixed asynchronous commands.&lt;/p&gt;
&lt;p&gt;Many thanks to Daniel Read for his assistance on these posts.&lt;/p&gt;
</description>
 <pubDate>Tue, 25 Oct 2005 01:18:17 -0700</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">comment 581 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Run DOS Commands from .NET with Free msDOScommand Class</title>
 <link>http://www.developerdotstar.com/community/node/280</link>
 <description>&lt;p&gt;The msDOScommand class, written in Visual Basic.Net, executes MS-DOS commands and provides both status and results.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.developerdotstar.com/community/node/280&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.developerdotstar.com/community/node/280#comment</comments>
 <category domain="http://www.developerdotstar.com/community/taxonomy/term/19">Visual Basic</category>
 <pubDate>Mon, 24 Oct 2005 06:32:46 -0700</pubDate>
 <dc:creator>Edward G Nilges</dc:creator>
 <guid isPermaLink="false">280 at http://www.developerdotstar.com/community</guid>
</item>
</channel>
</rss>
