Mar-17-2018, 12:40 PM
Hello. I have been using the subprocess module to call Windows commands from within my script. I have been trying to call the nbtstat command, but get the following error: WindowsError: [Error 2] The system cannot find the file specified
Here is the code with causes this error to occur:
Here is the code with causes this error to occur:
import subprocess p = subprocess.Popen(['nbtstat', '-A', '192.168.2.10'], std=subprocess.PIPE)I also tried using the full path to nbtstat below, but still got the same error:
p = subprocess.Popen(['C:\\Windows\\System32\\nbtstat.exe', '-A', '192.168.2.10'], stdout=subprocess.PIPE)What could be the reason for the WindowsError?