例如
TestString= 'User'
subprocess.run([r"psshutdown.exe", "\\\\192.168.0.1 -u "+TestString])
The TestString
is changed to USER
.
Why and how can I avoid it?
例如
TestString= 'User'
subprocess.run([r"psshutdown.exe", "\\\\192.168.0.1 -u "+TestString])
The TestString
is changed to USER
.
Why and how can I avoid it?
You need to put each command argument in a separate list element. The way you've done it, it thinks
"\\\\192.168.0.1 -u "+TestString
is a single parameter, the name of the computer to shut down. Computer names are case-insensitive, so it's converting it to uppercase.