Force start and close a program on Windows 7 startup?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
sabelstrom
Posts: 18
Joined: 08 Oct 2016 07:42

Force start and close a program on Windows 7 startup?

#1 Post by sabelstrom » 11 Jan 2017 16:18

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

sabelstrom
Posts: 18
Joined: 08 Oct 2016 07:42

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

#2 Post by sabelstrom » 12 Jan 2017 02:37

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();

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

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

#3 Post by Squashman » 12 Jan 2017 07:37

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.

Post Reply