hi
how can find a process pid number and close that process by pid in nsis?
for example how can find "firefox.exe" pid number process and close that by pid?
i see plugin Get process info just can find nsis (project) process info. i need find other process info.....
thanks
find process PID number and close by pid...
6 posts
Have you tried the LockedList plugin, it works quite well for closing required processes.
Another solution that requires more work is to find the PID's for a process name from the command prompt, and output it to file. You will then have to write a script to loop through the output and to close it.
e.g. wmic /OUTPUT:C:\ProcessList.txt process where (Name="firefox.exe") get Processid
You can also close the processes using the ImageName or PID using the following commands from the command prompt.
e.g. TASKKILL /F /IM firefox.exe or TASKKILL /F /PID 6832
Another solution that requires more work is to find the PID's for a process name from the command prompt, and output it to file. You will then have to write a script to loop through the output and to close it.
e.g. wmic /OUTPUT:C:\ProcessList.txt process where (Name="firefox.exe") get Processid
You can also close the processes using the ImageName or PID using the following commands from the command prompt.
e.g. TASKKILL /F /IM firefox.exe or TASKKILL /F /PID 6832
Originally Posted by DO_Visser View PostHave you tried the LockedList plugin, it works quite well for closing required processes.
Another solution that requires more work is to find the PID's for a process name from the command prompt, and output it to file. You will then have to write a script to loop through the output and to close it.
e.g. wmic /OUTPUT:C:\ProcessList.txt process where (Name="firefox.exe") get Processid
You can also close the processes using the ImageName or PID using the following commands from the command prompt.
e.g. TASKKILL /F /IM firefox.exe or TASKKILL /F /PID 6832
thanks my friend
i use this:
ShowInstDetails show
!include MUI.nsh
Section
FindProcDLL::FindProc "firefox.exe"
Pop $R0
${If} $R0 = 1
goto back1
${Else}
goto end1
${EndIf}
back1:
LockedList::FindProcess "firefox.exe"
Pop $R0
nsExec::Exec 'taskkill /f /pid $R0 /T' ;-----task kill Silent;
FindProcDLL::FindProc "firefox.exe"
Pop $R0
${If} $R0 != 1
goto back1
${Else}
goto end1
${EndIf}
end1:
SectionEnd
there are way faster this way?
You should not be killing firefox.exe! You can run Firefox with multiple profiles and you can have more than one version of Firefox installed, how do you know which Firefox to close? Closing all instances of Firefox would be evil. I don't even understand why you think you need to close Firefox in the first place...
i make a program for users
all users can use from program.
in this program if a process special runed,my program not runed,Because processes the overlapping.
i can close that process if runed except just kill with pid number.
all users can use from program.
in this program if a process special runed,my program not runed,Because processes the overlapping.
i can close that process if runed except just kill with pid number.
I have no idea what any of that means and I don't understand why you keep talking about PIDs.Originally Posted by r2du-soft View Posti use a program for users
all users can use from program but if a process special run program not runed,Because processes the overlapping and i can close that process if runed except kill with pid number.
Unless you called CreateProcess yourself or have/know the handle/PID of a specific process then talking about PIDs seems pointless. Going from exe name to PID and then killing by PID is just extra work. Any plugin/program that allows you to kill by exe name is going to map from exe name to PID internally anyway because the only way to open a process is by PID...