Shell, Process.start cannot find file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nikolas via .NET 247

    Shell, Process.start cannot find file

    Hello All,

    I am trying to start some processes from a VB.NET applicationwind ow.
    BUT; I dont want to hardwire the filenames by using the wholepathname of the .exe eg:
    Shell(c:\window s\calc.exe"). The reason being that I want theapplication to be universal and not to rely on the user havingthe .EXEs installed in any specific folder even if this is arather simple "c:\programFile s" etc. Well, so far so good had Iwant to start windows applications such as notepad orcalculator. Can I use process.start (yes I know I have to useprocessInfo) with any .exe I like installed anywhere in the harddrive? And if not how do I star processes without hardwiringthem in my application?

    Greatfull in advance.
    --------------------------------
    From: Nikolas

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>lBEQsNX41kW E/GTMUHWWLA==</Id>
  • Herfried K. Wagner [MVP]

    #2
    Re: Shell, Process.start cannot find file

    * Nikolas via .NET 247 <anonymous@dotn et247.com> scripsit:[color=blue]
    > I am trying to start some processes from a VB.NET application window.
    > BUT; I dont want to hardwire the filenames by using the whole pathname of the .exe eg:
    > Shell(c:\window s\calc.exe"). The reason being that I want the
    > application to be universal and not to rely on the user having the .EXEs
    > installed in any specific folder even if this is a rather simple
    > "c:\programFile s" etc. Well, so far so good had I want to start windows
    > applications such as notepad or calculator. Can I use process.start (yes
    > I know I have to use processInfo) with any .exe I like installed
    > anywhere in the hard drive? And if not how do I star processes without
    > hardwiring them in my application?[/color]

    If the path containing the file is not mentioned in the 'PATH'
    environment variable and/or some other locations, you will have to
    search for the file:

    <URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnume rator.zip>

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    Working...