B
Bruno
Hello,
I createted a Windows service as shown in the folowing video
http://www.labo-dotnet.com/Videos/Veille/Créer un Service Windows/0/1304.aspx
Now I added Process1 and Process2, two actions to execute when the
service starts and stops. I declared:
// TODO : ajoutez ici le code pour démarrer votre service.
this.eventLog1.WriteEntry("Service Démarré");
this.process1.Start();
}
/// <summary>
/// Arrêt du service.
/// </summary>
protected override void OnStop()
{
// TODO : ajoutez ici le code pour effectuer les destructions
nécessaires à l'arrêt de votre service.
this.eventLog1.WriteEntry("Service Stoppé");
this.process2.Start();
}
The command I want to execute in process1 and process2 is:
%OVPERLBIN% %OvAgentDir%\bin\Opc\cmds\SwitchControl.pl Start VtomClt
(Process1)
%OVPERLBIN% %OvAgentDir%\bin\Opc\cmds\SwitchControl.pl Stop VtomClt
(Process2)
%OVPERLBIN% = d:\usr\OV\bin\perl.exe
Of course the variable exists in the target machine.
In StartInfo Filename, I wrote d:\usr\OV\bin\perl.exe and in Arguments
%OvAgentDir%\bin\Opc\cmds\SwitchControl.pl Start VtomClt, this works
all right when I start and stop the service.
Now my problem appears when I want to write the variable %OVPERLBIN%
instead of the absolute path of the perl.exe command line (in
Filename).
Thanks by advance for your help
I createted a Windows service as shown in the folowing video
http://www.labo-dotnet.com/Videos/Veille/Créer un Service Windows/0/1304.aspx
Now I added Process1 and Process2, two actions to execute when the
service starts and stops. I declared:
// TODO : ajoutez ici le code pour démarrer votre service.
this.eventLog1.WriteEntry("Service Démarré");
this.process1.Start();
}
/// <summary>
/// Arrêt du service.
/// </summary>
protected override void OnStop()
{
// TODO : ajoutez ici le code pour effectuer les destructions
nécessaires à l'arrêt de votre service.
this.eventLog1.WriteEntry("Service Stoppé");
this.process2.Start();
}
The command I want to execute in process1 and process2 is:
%OVPERLBIN% %OvAgentDir%\bin\Opc\cmds\SwitchControl.pl Start VtomClt
(Process1)
%OVPERLBIN% %OvAgentDir%\bin\Opc\cmds\SwitchControl.pl Stop VtomClt
(Process2)
%OVPERLBIN% = d:\usr\OV\bin\perl.exe
Of course the variable exists in the target machine.
In StartInfo Filename, I wrote d:\usr\OV\bin\perl.exe and in Arguments
%OvAgentDir%\bin\Opc\cmds\SwitchControl.pl Start VtomClt, this works
all right when I start and stop the service.
Now my problem appears when I want to write the variable %OVPERLBIN%
instead of the absolute path of the perl.exe command line (in
Filename).
Thanks by advance for your help