Click here to Skip to main content
15,891,864 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionTry Catch does not Execute Catch code Pin
treddie2-May-13 18:31
treddie2-May-13 18:31 
AnswerRe: Try Catch does not Execute Catch code Pin
Richard MacCutchan2-May-13 21:41
mveRichard MacCutchan2-May-13 21:41 
GeneralRe: Try Catch does not Execute Catch code Pin
treddie2-May-13 22:02
treddie2-May-13 22:02 
QuestionMethod signature does not match delegate - thread safe Pin
Member 100187622-May-13 7:12
Member 100187622-May-13 7:12 
AnswerRe: Method signature does not match delegate - thread safe Pin
Richard Deeming2-May-13 8:21
mveRichard Deeming2-May-13 8:21 
GeneralRe: Method signature does not match delegate - thread safe Pin
Member 100187622-May-13 11:00
Member 100187622-May-13 11:00 
GeneralRe: Method signature does not match delegate - thread safe Pin
Alan N2-May-13 12:26
Alan N2-May-13 12:26 
QuestionTrouble passing arguments to System.Diagnostics.Process.Start Pin
savedlema2-May-13 0:07
savedlema2-May-13 0:07 
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:

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


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



Then I did this:

VB
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)
AnswerRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
Richard MacCutchan2-May-13 1:07
mveRichard MacCutchan2-May-13 1:07 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
Richard Deeming2-May-13 1:23
mveRichard Deeming2-May-13 1:23 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
Richard MacCutchan2-May-13 1:27
mveRichard MacCutchan2-May-13 1:27 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
savedlema2-May-13 8:06
savedlema2-May-13 8:06 
AnswerRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
Eddy Vluggen2-May-13 5:07
professionalEddy Vluggen2-May-13 5:07 
AnswerRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
Alan N2-May-13 5:44
Alan N2-May-13 5:44 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
savedlema2-May-13 8:01
savedlema2-May-13 8:01 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
Alan N2-May-13 8:17
Alan N2-May-13 8:17 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
savedlema3-May-13 0:54
savedlema3-May-13 0:54 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
Alan N3-May-13 2:57
Alan N3-May-13 2:57 
GeneralRe: Trouble passing arguments to System.Diagnostics.Process.Start Pin
savedlema3-May-13 4:24
savedlema3-May-13 4:24 
QuestionWord VBA: quickly checking if table is uniform from 3rd row on Pin
Bart Van Eyndhoven1-May-13 23:08
Bart Van Eyndhoven1-May-13 23:08 
AnswerRe: Word VBA: quickly checking if table is uniform from 3rd row on Pin
Kenneth Haugland2-May-13 2:28
mvaKenneth Haugland2-May-13 2:28 
QuestionRe: Word VBA: quickly checking if table is uniform from 3rd row on Pin
Kenneth Haugland2-May-13 2:37
mvaKenneth Haugland2-May-13 2:37 
AnswerRe: Word VBA: quickly checking if table is uniform from 3rd row on Pin
Bart Van Eyndhoven2-May-13 4:23
Bart Van Eyndhoven2-May-13 4:23 
GeneralRe: Word VBA: quickly checking if table is uniform from 3rd row on Pin
Kenneth Haugland2-May-13 4:54
mvaKenneth Haugland2-May-13 4:54 
GeneralRe: Word VBA: quickly checking if table is uniform from 3rd row on Pin
Bart Van Eyndhoven2-May-13 21:51
Bart Van Eyndhoven2-May-13 21:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.