I made a batch file that kills a couple tasks and restarts them like so:
taskkill /f /im "task1.exe"
taskkill /f /im task2.exe
start C:\path\task.exe
This bat file runs fine when run through a cmd prompt. However, when trying to run it through NppExec, the first taskkill
fails with Reason: Access is denied.
The second taskkill
and the start
work fine.
Why might one fail and another succeed when running the batch via command prompt has both succeed? How might I fix it so both tasks end?
Answer
Try running Notepad++ as an administrator. If you use multiple users on the system, you may also want to check which user is running the app. Taskkill can be fickle with some running apps based on who launched them. Admin mode can sometimes overcome this, though I'm not sure how the NppExec plugin actually launches things.
No comments:
Post a Comment