2

I am using Windows 10.

I have a program that allows me to run another program when a particular event is triggered. I can specify a batch file, which the program does run successfully.

However, I am trying to restart the original program when the event is triggered.

I have a TASKKILL, TIMEOUT, START batch file.

Unfortunately, as soon as the TASKKILL is executed, not only does the original program terminate, but the batch file script also terminates. So it never gets to the START command.

I tried cascading two batch files, running in two separate CMD windows, but that did not solve the problem. They apparently are all considered to be children of the original program.

Any suggestions?

FYI, The program that I am running is ClocX. The event is an alarm going off.

2
  • 3
    Why not use Tasak Scheduler? Sep 3, 2019 at 5:14
  • I was considering something like that. That would involve maintaining event times in two places (in the program and in the task scheduler), but that is an option. Even if I do go that route, I would still like to know how to launch a program that is separate from (not a child task of) the program that launched it. And how to get a program to restart itself.
    – dddiam
    Sep 3, 2019 at 17:44

1 Answer 1

0

I test using admin account taskkill /f /im clocx.exe" and this works, also, when in no admin user account this command not work.

Try this using admin rights, need only 1 time ::


takeown /F "C:\Program Files (x86)\ClocX\ClocX.exe" /a

After this, you can start Clock.exe and also kill:


call "C:\Program Files (x86)\ClocX\ClocX.exe"
echo/ do some tasks by here...
echo/ do some tasks by and here...
echo/ do some tasks by also here...
echo/ if need to kill, just use...
taskkill /f /im ClocX.exe

So sorry my limited english!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .