SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

VB.Net - How to execute a program + arguments?

Last post 03-18-2008 8:50 AM by riyas50. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-13-2007 7:24 AM

    VB.Net - How to execute a program + arguments?

    I wish to execute 7za.exe, which is located in the directory of my project files at the moment, with the argument

    "e"+strTheGadget+" -o C:\Program Files\Windows Sidebar\Shared Gadgets\"+strTheGadgetName+""

     So I used this:

    Process.Start("7za.exe e "+strTheGadget+" -o C:\Program Files\Windows Sidebar\Shared Gadgets\"+strTheGadgetName+"")

     However, #Develop throws up an error that it can't find the application... any help?

     I'm a n00b... I've just started with VB.NET...

    (I'm using 7zip because I can't figure out #ZipLib) 

    I changed my timezone from +10 to -12 to save myself from the almighty wrath of Friday the 13th.
    Filed under: ,
  • 04-13-2007 8:54 AM In reply to

    • VITRIOL
    • Top 100 Contributor
    • Joined on 08-22-2005
    • Italy
    • Posts 21

    Re: VB.Net - How to execute a program + arguments?

    Try to define the complete path of the executable, and to separate the arguments. For example:


    Process.Start("C:\Program Files\7-Zip\7z.exe", "Arguments here") 

  • 04-13-2007 9:14 AM In reply to

    Re: VB.Net - How to execute a program + arguments?

    I'm using 7z command line edition, and dropped it into the project folder.
    I changed my timezone from +10 to -12 to save myself from the almighty wrath of Friday the 13th.
  • 04-13-2007 9:27 AM In reply to

    • VITRIOL
    • Top 100 Contributor
    • Joined on 08-22-2005
    • Italy
    • Posts 21

    Re: VB.Net - How to execute a program + arguments?

    anger2headshot:
    I'm using 7z command line edition, and dropped it into the project folder.

    If you omit the path, you have to put  7z executable in the same directory of your application. By default in Debug or Release folder under YourProject/bin

  • 04-13-2007 9:28 AM In reply to

    Re: VB.Net - How to execute a program + arguments?

    It still can't find it
    I changed my timezone from +10 to -12 to save myself from the almighty wrath of Friday the 13th.
  • 04-13-2007 9:35 AM In reply to

    • VITRIOL
    • Top 100 Contributor
    • Joined on 08-22-2005
    • Italy
    • Posts 21

    Re: VB.Net - How to execute a program + arguments?

    anger2headshot:
    It still can't find it

    Have you tried without arguments? If it works (7z starts...) , you have to review your arguments string.

  • 04-13-2007 9:52 AM In reply to

    Re: VB.Net - How to execute a program + arguments?

    OK, without the arguments it still can't find 7za.exe (I did put it in bin/debug)

     

    Process.Start("C:\Program Files\7-Zip\7z.exe", "Arguments here")

     Didn't catch that... I'll try it later
     

    I changed my timezone from +10 to -12 to save myself from the almighty wrath of Friday the 13th.
  • 03-18-2008 8:50 AM In reply to

    Re: VB.Net - How to execute a program + arguments?

    try

    Process.Start("C:\\Program Files\\7-Zip\\7z.exe", "Arguments here") 

    instead of Process.Start("C:\Program Files\7-Zip\7z.exe", "Arguments here")  

Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.