I'm trying to use CMD command with python script for my small "autoinstall" project.
Command I want to use:
WMIC /NODE:'kv-c112-11' OS get Caption
What I've got:
result = subprocess.check_output(['WMIC', '/NODE:\"kv-c112-11\"', 'OS', 'get', 'Caption'])
result = str(result)
print(result)
In stdout I see:
b''
I expect to see:
b'Caption \r\r\n\x8c\xa0\xa9\xaa\xe0\xae\xe1\xae\xe4\xe2 Windows 10 \x8a\xae\xe0\xaf\xae\xe0\xa0\xe2\xa8\xa2\xad\xa0\xef LTSC \r\r\n\r\r\n'
If I use this code locally, it works:
result = subprocess.check_output(['WMIC','OS','get','Caption'])
What am I doing wrong?