Page 1 of 1

Force start and close a program on Windows 7 startup?

Posted: 11 Jan 2017 16:18
by sabelstrom
Hi.

I have a problem with Kodi 16 and 17 on my sons computer, some error with DX11, it cant be solved so i need a short cut.

First time after each reboot i start Kodi i get a error "Kodi is not responding" five seconds later it disappears and Kodi starts with a black screen, Alt + Tab solves it and Kodi works like a charm.

Every time i start Kodi after that it works fine.

So i need Kodi to start om Windows reboot and exit ten seconds later, that will solve the problem. This computer is for my six year old to use so its need to work fine.

Is there a script or batch file that will do this?

Thanks for reading about my problem.

Best Regards Richard Sabelström

Re: Force start and close a program on Windows 7 startup?

Posted: 12 Jan 2017 02:37
by sabelstrom
Got a solution in another forum:

Save this as STARTKODI.JS. Execute it anywhere you can at start of Windows.

WshShell = WScript.CreateObject("WScript.shell");
var command="kodi.exe"; //this may needs to be path fully qualified.
task=WshShell.Exec(command);
WScript.Sleep(10000);
task.Terminate();
WScript.Quit();

Re: Force start and close a program on Windows 7 startup?

Posted: 12 Jan 2017 07:37
by Squashman
Here is the definitive list of commands you can run in a batch file.
http://ss64.com/nt/
I bet you will find the commands you need to run in that list.