Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
';净';在python中不被识别为内部或外部命令、可操作程序或批处理文件_Python - Fatal编程技术网

';净';在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
。看见