command line - Python: find current directory of remote "cmd.exe" processes -
i write script among other things erases directory using shutil.rmtree
i have ensure no "cmd.exe" opened in directory (and blocking me erasing directory).
i can killing "cmd.exe" on remote computer:
process_name = "cmd.exe" computer_name = "atacama6" try: subprocess.check_call('taskkill.exe /s {} /u admin1 /p abc$ /im {}'\ .format(computer_name, process_name)) except subprocess.calledprocesserror: # no matches found - thats ok! pass
but afraid of killing "cmd.exe" processes opened in other directories , need run. how can kill ones opened in specific directory?
Comments
Post a Comment