@"-u myuser --password=mypass > my5 > F:\\MySQL\\Backup\\my5a";
produces :
-u myuser --password=mypass my5 > F:\\MySQL\\Backup\\my5a
as the output, which will fail silently as a bad path.
If you use the @ to create a literal string, remove the double slashes.
Use :
..Arguments =@"-u myuser --password=mypass > my5 > F:\MySQL\Backup\my5a";
OR use :
..Arguments ="-u myuser --password=mypass > my5 > F:\\MySQL\\Backup\\my5a";
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en espaņol :
http://asp.net.do/foros/
===================================
"christof" <> wrote in message news:...
>I wish to use an exe file, it looks like this:
>
>
> System.Diagnostics.Process mysqldump = new System.Diagnostics.Process();
>
> mysqldump.StartInfo.FileName = @"C:\Program Files\MySQL\MySQL Server
> 5.0\bin\mysqldump.exe";
>
>
> Response.Write(File.Exists(mysqldump.StartInfo.Fil eName).ToString()); //just to check if I'm
> pointing right
>
>
> mysqldump.StartInfo.Arguments = @"-u myuser --password=mypass my5 >
> F:\\MySQL\\Backup\\my5a";
>
> mysqldump.StartInfo.CreateNoWindow = false;
> mysqldump.StartInfo.ErrorDialog = true;
> mysqldump.StartInfo.RedirectStandardOutput = true;
> mysqldump.StartInfo.UseShellExecute = false;
>
>
> try
> {
> Response.Write(mysqldump.Start().ToString());
> }
> catch (Exception exc)
> {
> Response.Write(exc.Message);
> }
>
>
> I'm gettin True (file exists) and True (Process.Start()) and no exception is caught, but there is
> no effect.
>
> If i simply call in shell:
> mysqldump -u myuser --password=mypass my5 > F:\\MySQL\\Backup\\my5a
> it works fine, backup is created.
>
> What am I doing wrong?
>
> Thanks a lot