我正在尝试将目录更改为快捷方式导致的目录。
我正在运行的代码使用fnmatch查找与给定名称匹配的快捷方式:
for f in file:
if fnmatch.fnmatch(f,propname):
os.chdir(os.getcwd() + "\\" + f)
#checks if there's a read folder
file = os.listdir(os.getcwd())
但是我收到此错误:
NotADirectoryError: [WinError 267] The directory name is invalid: '\\\\100.100.1.100\\Share1\\CompanyU\\ClientFiles\\clientinfo.lnk'
如果通过快捷方式链接目录地址,是否可以获取目录地址?