FSO 删除文件/移动文件权限错误
我正在尝试使用经典的 asp fso 删除/移动文件,但收到此错误:
Microsoft VBScript runtime error '800a0046'
Permission denied
该文件位于 c:\files\test\file.txt
中,最终我想移动它到 c:\archive\file.txt
我开始使用 Move 但出现错误。然后我将其分为复制和删除。复制顺利,但在删除时仍然出现相同的错误。
我排除了 Delete 方法,因为我能够使用以下代码对“archive”文件夹中的文件使用 Delete:
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("C:\archive\file.txt")
f.Delete
set f=nothing
set fs=nothing
我还仔细检查了两个文件夹的权限它们与 IIS_IUSRS 完全相同:读取和执行、列出文件夹内容、读取、写入均被检查。我也尝试授予修改权限,但这没有什么区别。
最后,我检查了文件的属性,结果显示为 32(存档)。我也尝试过强制删除:
fso.DeleteFile FileName, true
I'm trying to delete/move a file using classic asp fso but I'm getting this error:
Microsoft VBScript runtime error '800a0046'
Permission denied
The file is located in c:\files\test\file.txt
and ultimately I want to move it to c:\archive\file.txt
I started out with Move but I got the error. Then I split it up into Copy and Delete. The copying went fine but still the same error on Delete.
I ruled out the Delete method because I was able to use Delete on the file in the 'archive' folder using this code:
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("C:\archive\file.txt")
f.Delete
set f=nothing
set fs=nothing
I also double-checked the permissions on both folders and they're exactly the same for IIS_IUSRS: Read&Execute, List folder contents, Read, Write are checked. I tried giving Modify rights as well but that made no difference.
Finally, I checked the file's attributes and it came back as 32 (Archive). I also tried to force the delete:
fso.DeleteFile FileName, true
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IIS_USRS 文件夹权限必须特别包括 Windows 中“高级”对话框中的“删除”。
IIS_USRS folder permissions had to specifically include 'Delete' from the 'Advanced' dialog in Windows.