Print Page | Close Window

Permission Denied

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5334
Printed Date: 30 March 2026 at 9:20pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Permission Denied
Posted By: pmormr
Subject: Permission Denied
Date Posted: 27 August 2003 at 6:49pm

I'm trying to execute the command "filesystemobject.copyfile". But every time i try it gives me a permission denied error. I've checked the permissions on the folder i'm copying to and it's set to "full control" i have no idea what is wrong. The code is as follows,

<%
   Response.Write "Please wait, now adding the comics to the database. <br><br><br>"
  
   Dim conn
   Set conn = Server.CreateObject("ADODB.Connection")
   conn.provider = "Microsoft.Jet.OLEDB.4.0"
   conn.open "c:\_db\database.mdb"
  
   Dim rs
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.open "SELECT * FROM [comic]", conn, 1
  
   Dim fso
   Set fso = Server.CreateObject("Scripting.FileSystemObject")
  
   Dim sf
   Set sf = fso.GetFolder("C:\Documents and Settings\Administrator\Desktop\Comics")
  
   Dim fn
   'fn = rs.recordcount
  
   Function search(strSearchText)
   'loop through every file in the folder
      For Each objFile in sf.Files
         Dim txt
         Set txt = fso.OpenTextFile(objFile.path, 1)
  
   Dim endloop  
         While NOT endloop
      line = txt.ReadLine
   If InStr(1, line, strSearchText, 1) then
      Dim line2, fname
      endloop = TRUE
      fn = fn + 1
      fname = "c:\comics\" & fn & ".gif"
      line2 = Replace(line, "<IMG SRC="" http://www.funnymail.com/webdata/cs/ - http://www.funnymail.com/webdata/cs/ ", "")
      line2 = Replace(line2,"""></P>","")
      line2 = Replace(line2,".gif", "[1].gif")
               mrpath = Trim("C:\comics\2change\") & Trim(line2)
      Response.Write mrpath & " will be saved as " & fname & "<br>"
      Response.Write "Saving...<br>"
      fso.copyfile mrpath, "c:\comics"
   End If
   Wend
   endloop = FALSE
  
         txt.Close
      Next
   End Function
  
   strtxt = "<IMG SRC="" http://www.funnymail.com/webdata/cs - http://www.funnymail.com/webdata/cs "
     
   Search strtxt
%>

does anyone see anything that i don't?



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Replies:
Posted By: pmormr
Date Posted: 27 August 2003 at 6:51pm

oops, i forgot the error

Microsoft VBScript runtime error '800a0046'

Permission denied

/scripts2save/comicadder2.asp, line 42

line 42 is 'fso.copyfile mrpath, "c:\comics"



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Phat
Date Posted: 27 August 2003 at 8:22pm

Sounds like you don't have the correct permissions for the folder. Just a guess though.

 



-------------
http://buildit.sitesell.com/sitebuildithome.html - Get a website that sells


Posted By: pmormr
Date Posted: 27 August 2003 at 8:29pm
did you read the beginning of my post? I'm positive the permissions are correctly set. WRITE permissions are given to that folder and all it's sub-folders

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Bunce
Date Posted: 27 August 2003 at 11:04pm

Just because you said it, doesn't mean its out of the question.  Count the number of times that posters have said they've got the correct permissions set on this forum, only to find that they didn't apply it to the IUSR_<MachineName> account.

That said, you might want to ensure that there are no script blocking utilities running on the server, such as Nortons, as this is known to interfere with FSO.

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: pmormr
Date Posted: 28 August 2003 at 10:31am

It's funny, i have my iUSR permissions set correctly and my firewall and AntiVirus software are set to allow script execution. The weird thing is that my scripts have been giving me some really strange errors lately. Stuff like "No Current Record" when i'm not accessing a database and this "Permission Denied" error. Maybe that blaster worm currupted some of my asp.dll file, what do you think are the chances of that?



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: MorningZ
Date Posted: 28 August 2003 at 10:53am

how about just doing something simple like trying to disable Antivirus first?

then you don't have to (wrongly) jump to conclusions of corrupt dll's



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Mart
Date Posted: 28 August 2003 at 11:27am

If its norton you dont need to completely kill it just turn off script blocking.

Mart.



Posted By: pmormr
Date Posted: 28 August 2003 at 1:17pm
it's still doesn't work with my antivirus software (Norton Corporate Edition) and firewall (BlackICE) disabled, same error

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Mart
Date Posted: 28 August 2003 at 3:16pm

I don't think a corrupt asp.dll is likely because fso is a seperate dll and if everything else on your site is working i don't think you need to worry about corrupt dlls.

Mart.



Posted By: pmormr
Date Posted: 28 August 2003 at 4:26pm

i guess your right, it's just so funny. I have no idea what to do, this script is supposed to save me time, not waste it. I'm going to try and write to my final folder (the one i'm trying to use is a test) and see if that works.



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: pmormr
Date Posted: 28 August 2003 at 4:32pm
well guies, i don't know what was wrong, it worked fine when i wrote it to a virtual directory within my site. Thanks for your help

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net