0

(Answering my own question for the future / others).

I have a process I'd like to kill by name (in my case from an InnoSetup from Pascal script). My issue is that my process is called MyVeryLongProcessName.exe and I don't have access to taskkill (just tskill).

On Windows XP (embedded) in this case, I tried with the following result:

c:\> tskill MyVeryLongProcessName
Could not find process: MyVeryLongProcessName

But if I renamed the process (and tried to kill it) it worked fine:

c:\> tskill MyShortProcess

My question is / was: how do I kill process with a long process name using tskill?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Duncan
  • 858
  • 1
  • 11
  • 29
  • Note that Inno 5.5 has built-in support for Restart Manager, which you should be using on Vista+ systems. But regardless of OS, if this is your process then you should not kill it externally, but rather send it a message to shut itself down gracefully. And if it's *not* your process then you probably shouldn't be killing it since you won't be able to guarantee that it's safe to do so. Just ask the user to shut it down for you and verify that they have done it. – Miral May 26 '13 at 20:44

1 Answers1

2

It appears that there is an 18 character limit on the processname parameter, and so with the very long process it was simply rejecting it.

The solution to kill MyVeryLongProcessName.exe is therefore:

c:\> tskill MyVeryLongProcessN

Too many / few characters in the tskill parameter and it will just return a process not found error.

Duncan
  • 858
  • 1
  • 11
  • 29