laxman Posted October 7, 2008 Posted October 7, 2008 Dear ALL, I am developing the windows application which interacts with one external hardware, with this hardware i have to run a command which perofrms an operation with the hardware. this i am running in the DOS, But actually this should run in back ground(Pageload) mean while i have to show another screen, i am able get run the command but whenever it is running the dos screen is showing and closing i want to avoid showing the dos screen how i can do this Quote
Nate Bross Posted October 7, 2008 Posted October 7, 2008 Not sure exactly what you mean, windows no longer runs ontop of dos, but you can still execute commandline programs. Try this: System.Diagnostics.Process.Start("yourCommandLine.exe /arg /arg /arg"); As for talking to hardware running dos, I'd need more information to give you advice. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
joe_pool_is Posted October 14, 2008 Posted October 14, 2008 If you truely want to run the DOS app in the background while the page is loading, try using a BackgroundWorker Thread. Using an anonymous method: using (BackgroundWorker worker = new BackgroundWorker()) { worker.DoWork += delegate { System.Diagnostics.Process.Start("yourCommandLine.exe /arg /arg /arg"); }; worker.RunWorkerCompleted += delegate { // do whatever you need to do with the values returned from the // command line exe. Cursor = Cursors.Default; }; worker.RunWorkerAsync(); if (worker.IsBusy == true) { Cursor = Cursors.AppStarting; } } Quote Avoid Sears Home Improvement
JumpyNET Posted October 21, 2008 Posted October 21, 2008 This should do the trick: Dim ExeString As String = "netsh.exe" Dim ArgumentString As String = "interface ip set address ""Local Area Connection"" static 192.168.0.83 255.255.255.0" Dim DosCommand As Process = New Process DosCommand.StartInfo.CreateNoWindow = True DosCommand.StartInfo.UseShellExecute = False DosCommand.StartInfo.WindowStyle = ProcessWindowStyle.Hidden DosCommand.StartInfo.FileName = ExeString DosCommand.StartInfo.Arguments = ArgumentString DosCommand.Start() You can use the following to check if the DOS program has ended: DosCommand.HasExited Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.