Call to Dos Operating System

how do I make a call to the dos operating system For instance, I wish visual basic to type this at the command line: "wordpad myresume"

Answer this question

Call to Dos Operating System

  • Matt_343

    Take a look at process.start


  • tody4

    twophase.exe is a fortran program that I have written. I think what is giving me problems are the spaces in "Documents and Settings" and "Two Phase Flow". If I type C:\Documents and Settings\trojan\Desktop\Two Phase Flow\twophase.exe in a command shell, I get an error, I have to put it all in " " but somehow the Process Start or even the Shell command is not doing that. Know what I mean
  • Hashim Ahmed

     OK - so you want to call a console application (DOS application)

    Process.Start will enable you to do this.

    http://msdn2.microsoft.com/en-us/library/h6ak8zt5.aspx

    An Example

     ' Run the Foo.bat passing in the path to a htm file.
    Process.Start("WordPad", "C:\test.txt")

    Obviously the path parameter here can be a variable or property from you Windows Application.  

     


  • R.Tutus

    so far this is what I have

    Process.Start("C:\Documents and Settings\trojan\Desktop\Two Phase Flow\twophase.exe")

    This should work, I think, but it doesnt.


  • GethWho

    Also if this is the current users desktop rather than hardcoding a path in there like that you can use the function to return the current path for the desktop.

    Dim s As String = ControlChars.Quote & My.Computer.FileSystem.SpecialDirectories.Desktop & "\Two Flow App.exe" & ControlChars.Quote

    Process.Start(s)

    There are a number of different special folders

    http://windowssdk.msdn.microsoft.com/en-us/library/ms172972.aspx


  • ColinCJ

    Um, is this post answered It sounds like you still have a problem, but the thread is marked answered.

    Did you put the parameter in 'quotes' e.g """C:\test.txt"""



  • Call to Dos Operating System