-1

Every morning when i restart Azure VM then i want to run batch file automatically.

This batch file is starting selenium grid. So what i did is added Task scheduler and created trigger to start script at Startup.

Then i tried to run the task manually but it doesnt do anything.

Although it may not be mandatory to paste code for batch file but still here it is

cmd /C start/MIN java -jar selenium-server-standalone-3.141.59.jar -role hub -port 4445
cmd /C start/MIN java -jar selenium-server-standalone-3.141.59.jar -role node  -hub http://localhost:4445/grid/register

I have windows server 2012. When i manually click batch file then it run but not working via startup script

James
  • 1,827
  • 5
  • 39
  • 69

1 Answers1

0

You can add the batch file to system registry

to execute if any user log in: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

to execute if only current user log in: [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

or

[HKEY_LOCAL_MACHINE\SOFTWARE\wow6432node\Microsoft\Windows\CurrentVersion\Run]
[HKEY_CURRENT_USER\SOFTWARE\wow6432node\Microsoft\Windows\CurrentVersion\Run]
pburgr
  • 1,722
  • 1
  • 11
  • 26