473,395 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ASP Move folder fails

Hello,
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
  1. <%
  2. Option Explicit
  3. On Error Resume Next
  4. Dim FSO
  5. Set FSO=Server.CreateObject("Scripting.FileSystemObject")
  6.  
  7. FSO.GetFolder("C:\test").Copy "D:\test1"
  8. If Err.Number <> 0 Then Response.Write("Copy to D:\test1 failed<br />")
  9. Err.Number = 0
  10. FSO.GetFolder("C:\test").Move "D:\test"
  11. If Err.Number <> 0 Then Response.Write("Move to D:\test failed<br />")
  12. Err.Number = 0
  13. FSO.GetFile("C:\test.txt").Copy "D:\test1.txt"
  14. If Err.Number <> 0 Then Response.Write("Copy to D:\test1.txt failed<br />")
  15. Err.Number = 0
  16. FSO.GetFile("C:\test.txt").Move "D:\test.txt"
  17. If Err.Number <> 0 Then Response.Write("Move to D:\test.txt failed<br />")
  18. Err.Number = 0
  19. %>
  20.  
The user has to authenticate itself to run the code, and, logging myself in as an administrator user, the result is
"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
Dec 26 '07 #1
2 2573
kenobewan
4,871 Expert 4TB
Should not be the folder permissions, you have should full control. More likely another process is using the folder and you will have deal with that before deleting. HTH.
Jan 3 '08 #2
jehrich
24
Hi Sandro,

If you are still experiencing this problem, try running procmon from Sysinternals (http://technet.microsoft.com/en-us/sysinternals/default.aspx) when the error happens. You should be able to tell from the output which files were in use or denied and why.

Good luck!

JE
Jan 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: bmgz | last post by:
I am have made a simple script that moves all desktop clutter (ie files that are not *.lnk) to a specified folder eg. c:\myhome\mydocs\desktopdebris\2003-12-16 ...
6
by: Daniel Bickett | last post by:
Hello, I'm writing an application in my pastime that moves files around to achieve various ends -- the specifics aren't particularly important. The shutil module was chosen as the means simply...
4
by: Pieter | last post by:
Hi, On the pc of one of my clients (W2000, Office 2003) I'm getting sometimes an exception when moving (Move) a MailItem to an Outlook-Folder: The RPC server is not available. (Exception from...
0
by: vssp | last post by:
Hai friend I am using thirt party open soucre in php to mail finction. I want to add additional functionality to move mail to folder. I want add new menu add new folder and select the mail and...
1
by: Mike P | last post by:
I am trying to move the contents of the inbox folder into a folder for archiving. I have found a few examples on MSDN (eg http://msdn2.microsoft.com/en-us/library/bb206765.aspx), but I don't...
0
by: =?Utf-8?B?Um95?= | last post by:
Hi I am trying to move a directory to a done folder after my processing is over. I am using Directory.Move which doesn't seem to work for already existing destination folder c:\<application...
3
by: jaeden99 | last post by:
I was wandering if nyone has a script to move files older than x days old? i've seen several to delete, but I don't want to delete. I would like to create a backup of the files first verify with...
0
nev
by: nev | last post by:
I have created custom folders and I wanna move some of my subscriptions to that folder. But everytime I try to check the particular subscriptions and select "move to folder..." then click GO, the...
4
by: mikkoO8 | last post by:
hi. im actually making a desktop cleaner that can move the files and icons to a folder inside the listview box. i can make the listview box filled with files contains at the desktop and i can make...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.