我有一个名为'prn‘的文件夹,它是通过云同步服务在Windows上创建的。
我不再是该服务的订阅者,并试图删除该文件夹。
该名称可能与Windows保留项冲突,我猜是打印队列的名称。
命令提示符拒绝目录存在。
E:\goDropBox\Dropbox>dir prn
Directory of \\.
File Not Found
E:\goDropBox\Dropbox>cd prn
The system cannot find the path specified.
E:\goDropBox\Dropbox>del prn
The filename, directory name, or volume label syntax is incorrect.
E:\goDropBox\Dropbox>Windows Explorer抛出..。
An unexpected error is keeping you from deleting the folder. If you continue to receive this error, you can use this error code to search for help with this problem.
Error 0x8007010B: The directory name is invalid
prn
Date created: 03/07/2013 搜索此错误消息的帮助主要提供有关任务调度程序、Windows更新和Outlook通讯簿的一些问题的建议。
我也尝试删除后,停止打印假脱机服务-同样的错误。
有什么想法吗?
谢谢
发布于 2013-09-26 09:22:36
运行"python",然后在提示输入:
import os
os.listdir(ur'\\?\E:\goDropBox\Dropbox\prn')( \\?\神奇地告诉它不要特别对待"prn“。您必须使用绝对路径。)
它应该在该目录中打印文件列表。因此,删除它们:
os.unlink(ur'\\?\E:\goDropBox\Dropbox\prn\file1')
os.unlink(ur'\\?\E:\goDropBox\Dropbox\prn\file2')然后删除以下内容:
os.rmdir(ur'\\?\E:\goDropBox\Dropbox\prn')上面的说明应该适用于Python2.x或3.3+。
(您还可以使用您熟悉的任何编程语言,只要它调用Win32 API调用的Unicode版本)。
编辑以添加:或尝试:
old = u"\\\\?\\E:\\goDropbox\\Dropbox\\prn"
new = u"\\\\?\\E:\\goDropbox\\Dropbox\\foo"
os.rename(old, new)(如果使用python 3,则在字符串之前省略u )
https://stackoverflow.com/questions/19024052
复制相似问题