Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a batch file in which i want to write some code which kills a particular app named "AMPPSS.exe" and wait until the process is dead and after the application is killed creates a file named "DONE".

I am new at using batch file. so, please help me if possible

Thanks in advance
Posted
Updated 8-May-21 13:57pm
v2
Comments
PIEBALDconsult 11-Jun-15 1:20am    
No. Not if you're just going to delete the question as soon as it's answered.
agent_kruger 11-Jun-15 1:27am    
no sir, the requirement of the project was wrongly interpreted and thus the question was deleted
OriginalGriff 11-Jun-15 1:31am    
If the "requirement is misinterpreted" (i.e. you explained it wrong the first time) then you explain that to the answerer and edit your question to provide better information.

Just deleting the question because you don't like the answer is rude: someone may have put some effort into answering the question you did set, rather than the one you meant to set.
So if that's what you are going to do, why would we bother to to put effort into answering you this time?
agent_kruger 11-Jun-15 2:49am    
no sir, i deleted before he answered and if he answered it before i deleted it then code project restricts a question that has answer to be deleted.
PIEBALDconsult 11-Jun-15 18:44pm    
That's no reason to delete a question. Someone may still benefit from the question even if you don't.
You could edit it or just leave it alone.

Type taskkill /? in a command window to see how to do it.
 
Share this answer
 
hey, i just experimented around. task manager(what i tested) cannot be killed except by it killing itself. System.exe is always not killable, because users claimed that by using task manager ( which at the time could kill anything no matter what the process was) was BSODing the computer. MEMZ-destructive cant even stop task manager. and about that "AMPPSS.exe" app, I would try using this code in python 3.9.3: (or if it doesnt work then then either you are or im using an incorrect version of python)

def process():
      
    name = ("AMPPSS.exe")
    try:
          
        for line in os.popen("ps ax | grep " + name + " | grep -v grep"): 
            fields = line.split()
              
            pid = fields[0] 
               
            os.kill(int(pid), signal.SIGKILL)

        print("Process terminated")
          
    except:
        if (pid).terminate = (True):
             os.open('DONE.txt')
   
process()
 
Share this answer
 
v2
Comments
Dave Kreskowiak 8-May-21 20:33pm    
I seriously doubt the OP is still looking for answer 6 years later.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900