Note that there are some explanatory texts on larger screens.

plurals
  1. POBatch file not executing through windows service
    primarykey
    data
    text
    <p>I have a scenario in which i have to create a windows service which will check that if the batch file is not running then it should execute that batch file.</p> <p>Moreover, my batch file is used for automation using Selenium for Application checkout.</p> <p>When i create that service, somehow the batch file is not executing and is not able to launch the selenium. When i see same in task manager, i can see a cmd instance is running but that cannot run my selenium.</p> <p>Code of my Project: Timer is set to 1 minute</p> <pre><code>private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (!File.Exists(ConfigurationManager.AppSettings["testFilePath"])) //To check whether batch file is running or not { System.Diagnostics.Process proc = new System.Diagnostics.Process(); // Declare New Process proc.StartInfo.FileName = ConfigurationManager.AppSettings["BatchFilePath"]; proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; proc.StartInfo.CreateNoWindow = true; proc.Start(); proc.WaitForExit(); } } </code></pre> <p>Batch File is like This:</p> <pre><code>copy C:\AutomatedTests\AHD\testingWS.txt C:\AutomatedTests\AHD\AHDExecutionService\testingWS.txt start cmd /k java -jar "C:\AHS_Automation\Release\UnifiedBillingSystem\Selenium RC\selenium-server-1.0.3\selenium-server.jar" </code></pre> <p>This code will check periodically that if batch file is not under execution then my service will start its execution otherwise will do nothing.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload