Hi all!
I'm stuck somewhere with starting a process from vb.net.
I want to start a mysqldump process from my vb.net. This code works perfect if I run it from windows command prompt:
"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"""
Then I took it to my VB App and put it in :
Process.Start ( "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --user=root --password=mypassword --host=localhost --port=3306 --database sakila > "C:\backup\sakilalbackup.sql""")
But If I put this to VB, it will only ofcourse, read only to the second " (that's "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" )
So, I decided to break the code into blocks as follows:
Dim stat As String
Dim stat2 As String
Dim stat3 As String
Dim stat4 As String
stat4 = """"
stat = "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe"""
stat2 = "--user=root --password=mkwatuke --host=localhost --port=3306 --database sakila >"
stat3 = "C:\backup\shekelbackup.sql"""
Then I joined all these stats to produce one line of code by this:
txtPath.Text = stat4 & "" & stat & " " & stat2 & "" & stat4 & stat3 & stat4 & stat4 & ""
(I have a textbox called txtPath)
On this txtPath textbox, the code looks similar to the one I executed with command prompt.
Then I did this:
Process.Start(txtPath.Text)
but, upon running this, I get the error "The system cannot find the file specified"
I even tried Process.Start (and put the all the 'stats' here), but I get the same problem.
I'm have verified that the same line of code is passed. (Otherwise, the code works in the command prompt)
What could be causing trouble? Any suggestions please. Any links to read more about the process.start?
Thanks.