Ver Mensaje Individual
  #1  
Antiguo 15-05-2008
JuanErasmo JuanErasmo is offline
Miembro
 
Registrado: ago 2005
Posts: 544
Reputación: 19
JuanErasmo Va por buen camino
ProcessStart y Argumento con Espacios incluidos

Buenas tardes amigos.

Estoy intentando este código:
Código:

string PathAbrir = "C:\\Archivos de Programa\\Fotos\\temporal.jpg";
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo myProcessStartInfo = new System.Diagnostics.ProcessStartInfo("C:\\WINDOWS\\system32\\mspaint.exe");

myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.Arguments = PathAbrir;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
myProcess.WaitForExit();

myProcess.Close();
Estoy intentando abrir y me lanza un error porque el argumento tiene espacios , me sale : "No se puede Abrir C:\\Archivos.bmp";

Lo probé en una ruta directa y funciona, pero necesito hacer el ShellExecute desde C:\\Archivos de Programa. Como se puede representar la ruta "Archivos de Programa", pero para que funcione con ShellExecute algo como Archivos%20de%20Programa?

Muchas Gracias!
Responder Con Cita