Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Trouble passing arguments to System.Diagnostics.Process.Start

Trouble passing arguments to System.Diagnostics.Process.Start

Scheduled Pinned Locked Moved Database
helpdatabasecsharpmysql
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    savedlema
    wrote on last edited by
    #1

    Hi all! I have trouble passing arguments to the Process.Start in VB.NET. What I want to accomplish is to backup a mysql database with its mysqldump.exe which is located in my C drive. I have a code that can do it perfectly when run in the command prompt. The problem if face comes when I want to pass that same code to the process.start. The code that does the work is :

    "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --user=root --password=mypassword --host=localhost --port=3306 --database sakila > "C:\backup\sakilabackup.sql"""

    To be sure, I broke the code into two blocks, and I placed them to two textboxes as follows:

    txtProgram.Text = "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" ,

    txtArguments.Text= "--user=root --password=mypassword --host=localhost --port=3306 --database sakila >"C:\backup\sakilabackup.sql"""

    Then I did this:

    System.Diagnostics.Process.Start(txtProgram.Text, txtArguments.Text)

    And it still bring me the error "The system cannot find the file specified" Error message. Can you please tell me what the problem is and how I can get through it? Please remember that, if I take the contents of txtProgram.text and txtArguments.text and put them to a command prompt, it works fine. *I have also searched other threads here, no one had an exact similar issue like mine. I will appreciate any help. (I use VB 2010)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups