Ejecucion de un BAT

28/07/2006 - 16:26 por Andres | Informe spam
Hola necesitaria saber si alguien ha tenido el mismo problema y si
encontraron alguna solucion.
Tengo una aplicacion que corre como un servicio. Esta llama a un archivo
BAT. que a su ves este llama a otro que realiza una serie de procesos. Aqui
va el codigo

El servicio que corre :

private static void RunProgram( string programName) {
try {

//Declare and instantiate a new process component.

Process myProc = new Process();


//Do not receive an event when the process exits.

myProc.EnableRaisingEvents = false;


//Start the process, and assign it to the process component.

myProc.StartInfo.FileName = programName;

ServiceLog.WriteEntry("ServiceRM",@"Executing program " +
programName ,ServiceLogEventType.Information);

myProc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;

myProc.Start();

}

catch (Exception ex) {

ServiceLog.WriteEntry("RmdMonSvc",@"Exception executing program " +
programName + ": " + ex.Message ,ServiceLogEventType.Error);

}

______________________________________________

La aplicacion llama al Bat [Restart.bat] cuyo contenido es :

call c:\Proyectos\Test\Test.bat
exit
______________________________________________

[Test.bat] realiza lo siguiete :

cd\
cd c:\Proyectos\Prueba\
pskill Prueba.exe
call .\Dll\Prueba.exe .\Config.txt


El problema que tengo es que no logro que se ejecute todo el bat Test.bat.
hace el pskill y cuado llama al .\Dll\Prueba.exe no pasa nada. Probe con
START .\Dll\Prueba.exe pero tampoco.

Si alguien me podria ayudar desde ya estaria muy agradecido.

Saludos
 

Leer las respuestas

#1 Marco Landeros
31/07/2006 - 17:17 | Informe spam
puede que el Servicio se caiga y por esa razon no te ejecute la sgte proceso.
revisa bien si es correcta la ejecucion de lo que llama el servicio.

Saludos
Lander

"Andres" wrote:

Hola necesitaria saber si alguien ha tenido el mismo problema y si
encontraron alguna solucion.
Tengo una aplicacion que corre como un servicio. Esta llama a un archivo
BAT. que a su ves este llama a otro que realiza una serie de procesos. Aqui
va el codigo

El servicio que corre :

private static void RunProgram( string programName) {
try {

//Declare and instantiate a new process component.

Process myProc = new Process();


//Do not receive an event when the process exits.

myProc.EnableRaisingEvents = false;


//Start the process, and assign it to the process component.

myProc.StartInfo.FileName = programName;

ServiceLog.WriteEntry("ServiceRM",@"Executing program " +
programName ,ServiceLogEventType.Information);

myProc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;

myProc.Start();

}

catch (Exception ex) {

ServiceLog.WriteEntry("RmdMonSvc",@"Exception executing program " +
programName + ": " + ex.Message ,ServiceLogEventType.Error);

}

______________________________________________

La aplicacion llama al Bat [Restart.bat] cuyo contenido es :

call c:\Proyectos\Test\Test.bat
exit
______________________________________________

[Test.bat] realiza lo siguiete :

cd\
cd c:\Proyectos\Prueba\
pskill Prueba.exe
call .\Dll\Prueba.exe .\Config.txt


El problema que tengo es que no logro que se ejecute todo el bat Test.bat.
hace el pskill y cuado llama al .\Dll\Prueba.exe no pasa nada. Probe con
START .\Dll\Prueba.exe pero tampoco.

Si alguien me podria ayudar desde ya estaria muy agradecido.

Saludos



Preguntas similares