Is there something similar to bash $! moniker in windows to access the last process id that I can use in "TASKKILL /F /T /PID $pid"? I see that Microsoft SQL has @@IDENTITY to get the id of the last created object. Does batch shell has a command for the same purpose?
            Asked
            
        
        
            Active
            
        
            Viewed 276 times
        
    1
            
            
        - 
                    1Don't think you can. But there are some insights here: http://stackoverflow.com/questions/1807794/how-to-capture-the-pid-of-a-process-when-launching-it-in-dos – James L. Nov 13 '13 at 19:32
 - 
                    @DavidCandy Do not make programs simple and reliable. Make them complex and doing windows instead what you need. Thanks, I have got the Windows spirit. – Val Nov 14 '13 at 05:17