I have a IIS 6.0 webserver (windows 2003 EE) and, working on an asp project, noticed that oddly the server refuses to move a folder from one drive to another. Take the following code:
Expand|Select|Wrap|Line Numbers
- <%
- Option Explicit
- On Error Resume Next
- Dim FSO
- Set FSO=Server.CreateObject("Scripting.FileSystemObject")
- FSO.GetFolder("C:\test").Copy "D:\test1"
- If Err.Number <> 0 Then Response.Write("Copy to D:\test1 failed<br />")
- Err.Number = 0
- FSO.GetFolder("C:\test").Move "D:\test"
- If Err.Number <> 0 Then Response.Write("Move to D:\test failed<br />")
- Err.Number = 0
- FSO.GetFile("C:\test.txt").Copy "D:\test1.txt"
- If Err.Number <> 0 Then Response.Write("Copy to D:\test1.txt failed<br />")
- Err.Number = 0
- FSO.GetFile("C:\test.txt").Move "D:\test.txt"
- If Err.Number <> 0 Then Response.Write("Move to D:\test.txt failed<br />")
- Err.Number = 0
- %>
"Move to D:\test failed".
Any other operation seems to work fine, moving a folder from one place to another in the same drive also doesn't cause any problems. Removing the "on error resume next" I get
error '800a0046' - Access denied
though administrators have full access to any location on my server...
Also running the script in a vbs file locally fails, as well as running the vbs script on another pc...
Any idea what is wrong?
Thanks for any suggestions!
Regards,
Sandro Mani