';净';在python中不被识别为内部或外部命令、可操作程序或批处理文件
我正在尝试连接到网络驱动器, 我已经写了下面的代码。 但是我正在获取';净';在python中不被识别为内部或外部命令、可操作程序或批处理文件,python,Python,我正在尝试连接到网络驱动器, 我已经写了下面的代码。 但是我正在获取“net”未被识别为内部或外部命令 import copy,random, unicodedata, re, os import subprocess, netrc password = "MyPWD" domain_name = "MyDomain" user_name = "MyName" subprocess.call(r'net use m: /del', shell=True) os.system(r"NET US
“net”未被识别为内部或外部命令
import copy,random, unicodedata, re, os
import subprocess, netrc
password = "MyPWD"
domain_name = "MyDomain"
user_name = "MyName"
subprocess.call(r'net use m: /del', shell=True)
os.system(r"NET USE m: \\fileshare\\Users\\Dir %s /USER:%s\%s" % (password, domain_name, user_name))
有同样的问题@kindall的评论让我找到了解决这个问题的正确途径,但对我来说,路径是
%windir%\SysWOW64\net
您可能是64位Windows文件系统重定向程序的受害者。请尝试%windir%\Sysnative\net
,而不仅仅是net
。看见