access denied when trying to copy a file 
Author Message
 access denied when trying to copy a file

Hi everybody

I am getting access denied when I am trying to copy a file from a network
share to the local machine.  All of the permissions are set correct.  I
don't know what is going on.  I am using the
Wscript.CreateObject("Scripting.FileSystemObject") and still no bueno.  Any
thoughts?

--
Seth Fraundorf, MCP+I, MCSE
Internet Developer/LAN/WAN Technician

----------
If you want to reply by email, take out the no-spam
---------



Tue, 04 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
If you copy without setting the overwrite option to True and the target file
is marked read-only
Or
the target file is in-use

you'll get the "Access Denied" message.

--
Michael Harris


| Hi everybody
|
| I am getting access denied when I am trying to copy a file from a network
| share to the local machine.  All of the permissions are set correct.  I
| don't know what is going on.  I am using the
| Wscript.CreateObject("Scripting.FileSystemObject") and still no bueno.
Any
| thoughts?
|
|
| --
| Seth Fraundorf, MCP+I, MCSE
| Internet Developer/LAN/WAN Technician

| ----------
| If you want to reply by email, take out the no-spam
| ---------
|
|
|



Tue, 04 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
I tried writing a program once to move personal shares from one server to
another, and I ran into this same problem.  I tried moving and I tried
copying, and the destination folder didn't exist until the VBScript created
it.  I could get it to work for the files that weren't in any subfolder of
the personal share, but the subfolders and their contents wouldn't be
created and my program was also denied access at that point.  I was running
it while logged onto a BDC as the domain administrator, trying to move the
shares from the PDC (which is NT 3.51, so WSH won't work there).  Has anyone
any other ideas why access would be denied?

                                        Chick Tower

Quote:

>If you copy without setting the overwrite option to True and the target
file
>is marked read-only
>Or
>the target file is in-use

>you'll get the "Access Denied" message.

>--
>Michael Harris


message

>| I am getting access denied when I am trying to copy a file from a network
>| share to the local machine.  All of the permissions are set correct.



Tue, 04 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
I have the orverwrite option set to True and the file is not read only, but
I get the same error.


Quote:
> If you copy without setting the overwrite option to True and the target
file
> is marked read-only
> Or
> the target file is in-use

> you'll get the "Access Denied" message.

> --
> Michael Harris



> | Hi everybody
> |
> | I am getting access denied when I am trying to copy a file from a
network
> | share to the local machine.  All of the permissions are set correct.  I
> | don't know what is going on.  I am using the
> | Wscript.CreateObject("Scripting.FileSystemObject") and still no bueno.
> Any
> | thoughts?
> |
> |
> | --
> | Seth Fraundorf, MCP+I, MCSE
> | Internet Developer/LAN/WAN Technician

> | ----------
> | If you want to reply by email, take out the no-spam
> | ---------
> |
> |
> |



Tue, 04 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
Have you also eliminated the "in-use" possibility???

--
Michael Harris


| I have the orverwrite option set to True and the file is not read only,
but
| I get the same error.
|
|


| > If you copy without setting the overwrite option to True and the target
| file
| > is marked read-only
| > Or
| > the target file is in-use
| >
| > you'll get the "Access Denied" message.
| >
| > --
| > Michael Harris
| >
| >


| > | Hi everybody
| > |
| > | I am getting access denied when I am trying to copy a file from a
| network
| > | share to the local machine.  All of the permissions are set correct.
I
| > | don't know what is going on.  I am using the
| > | Wscript.CreateObject("Scripting.FileSystemObject") and still no bueno.
| > Any
| > | thoughts?
| > |
| > |
| > | --
| > | Seth Fraundorf, MCP+I, MCSE
| > | Internet Developer/LAN/WAN Technician

| > | ----------
| > | If you want to reply by email, take out the no-spam
| > | ---------
| > |
| > |
| > |
| >
| >
|
|



Tue, 04 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
I have deleted the file, rebooted and try running the script again.  It
still gives me the same error.  But if I tell it drop it in a different
directory, all works fine.  I can manunally copy the files needed.  I dunno,
probably something screwed in my script


Quote:
> Have you also eliminated the "in-use" possibility???

> --
> Michael Harris



> | I have the orverwrite option set to True and the file is not read only,
> but
> | I get the same error.
> |
> |


> | > If you copy without setting the overwrite option to True and the
target
> | file
> | > is marked read-only
> | > Or
> | > the target file is in-use
> | >
> | > you'll get the "Access Denied" message.
> | >
> | > --
> | > Michael Harris
> | >
> | >


> | > | Hi everybody
> | > |
> | > | I am getting access denied when I am trying to copy a file from a
> | network
> | > | share to the local machine.  All of the permissions are set correct.
> I
> | > | don't know what is going on.  I am using the
> | > | Wscript.CreateObject("Scripting.FileSystemObject") and still no
bueno.
> | > Any
> | > | thoughts?
> | > |
> | > |
> | > | --
> | > | Seth Fraundorf, MCP+I, MCSE
> | > | Internet Developer/LAN/WAN Technician

> | > | ----------
> | > | If you want to reply by email, take out the no-spam
> | > | ---------
> | > |
> | > |
> | > |
> | >
> | >
> |
> |



Fri, 07 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
The file system object has 2 copy methods. One is oFS.CopyFile(Source,
Destination) where oFS is a filesystem object, and the other is
oFile.Copy(Destination)where oFile is a File object(for example For
Each oFile in oFolder... ). I have had this problem with one in the
past and solved it by using the other. I never got to the bottom of why
one should work and not the other - I suppose once I get something to
work I normally just move on.

This is probably no help, but it's a suggestion.

Sen Hennessy



Quote:
> I have deleted the file, rebooted and try running the script again.
It
> still gives me the same error.  But if I tell it drop it in a
different
> directory, all works fine.  I can manunally copy the files needed.  I
dunno,
> probably something screwed in my script



> > Have you also eliminated the "in-use" possibility???

> > --
> > Michael Harris



> > | I have the orverwrite option set to True and the file is not read
only,
> > but
> > | I get the same error.
> > |
> > |


> > | > If you copy without setting the overwrite option to True and the
> target
> > | file
> > | > is marked read-only
> > | > Or
> > | > the target file is in-use
> > | >
> > | > you'll get the "Access Denied" message.
> > | >
> > | > --
> > | > Michael Harris
> > | >
> > | >

message

> > | > | Hi everybody
> > | > |
> > | > | I am getting access denied when I am trying to copy a file
from a
> > | network
> > | > | share to the local machine.  All of the permissions are set
correct.
> > I
> > | > | don't know what is going on.  I am using the
> > | > | Wscript.CreateObject("Scripting.FileSystemObject") and still
no
> bueno.
> > | > Any
> > | > | thoughts?
> > | > |
> > | > |
> > | > | --
> > | > | Seth Fraundorf, MCP+I, MCSE
> > | > | Internet Developer/LAN/WAN Technician

> > | > | ----------
> > | > | If you want to reply by email, take out the no-spam
> > | > | ---------
> > | > |
> > | > |
> > | > |
> > | >
> > | >
> > |
> > |

--
Sen Hennessy
Two Dots Ltd.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Fri, 07 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
If the "destination" is a folder, _always_ include the trailing backslash to
avoid any ambiguity.  If you copy a single file (explicit, no wildcards) and the
destination is assumed to be a file unless the final \ is stated explicitly
(after all, you _can_ have a file name that has no extension).

Other than all the obvious reasons for the "permission denied" already posted,
this is one that happens when the lack of the backslash causes the copy or
copyfile method to assume the destination is a filename and fails because the
name already exists as a folder.

--
Michael Harris


| The file system object has 2 copy methods. One is oFS.CopyFile(Source,
| Destination) where oFS is a filesystem object, and the other is
| oFile.Copy(Destination)where oFile is a File object(for example For
| Each oFile in oFolder... ). I have had this problem with one in the
| past and solved it by using the other. I never got to the bottom of why
| one should work and not the other - I suppose once I get something to
| work I normally just move on.
|
| This is probably no help, but it's a suggestion.
|
| Sen Hennessy
|
|


| > I have deleted the file, rebooted and try running the script again.
| It
| > still gives me the same error.  But if I tell it drop it in a
| different
| > directory, all works fine.  I can manunally copy the files needed.  I
| dunno,
| > probably something screwed in my script
| >


| > > Have you also eliminated the "in-use" possibility???
| > >
| > > --
| > > Michael Harris
| > >
| > >


| > > | I have the orverwrite option set to True and the file is not read
| only,
| > > but
| > > | I get the same error.
| > > |
| > > |


| > > | > If you copy without setting the overwrite option to True and the
| > target
| > > | file
| > > | > is marked read-only
| > > | > Or
| > > | > the target file is in-use
| > > | >
| > > | > you'll get the "Access Denied" message.
| > > | >
| > > | > --
| > > | > Michael Harris
| > > | >
| > > | >

| message

| > > | > | Hi everybody
| > > | > |
| > > | > | I am getting access denied when I am trying to copy a file
| from a
| > > | network
| > > | > | share to the local machine.  All of the permissions are set
| correct.
| > > I
| > > | > | don't know what is going on.  I am using the
| > > | > | Wscript.CreateObject("Scripting.FileSystemObject") and still
| no
| > bueno.
| > > | > Any
| > > | > | thoughts?
| > > | > |
| > > | > |
| > > | > | --
| > > | > | Seth Fraundorf, MCP+I, MCSE
| > > | > | Internet Developer/LAN/WAN Technician

| > > | > | ----------
| > > | > | If you want to reply by email, take out the no-spam
| > > | > | ---------
| > > | > |
| > > | > |
| > > | > |
| > > | >
| > > | >
| > > |
| > > |
| > >
| > >
| >
| >
|
| --
| Sen Hennessy
| Two Dots Ltd.
|
|
| Sent via Deja.com http://www.deja.com/
| Share what you know. Learn what you don't.



Fri, 07 Dec 2001 03:00:00 GMT  
 access denied when trying to copy a file
well putting the ending \ on the folder name works.  I thought I tired that,
but guess not.  Thanks for your help.

Seth


Quote:
> If the "destination" is a folder, _always_ include the trailing backslash
to
> avoid any ambiguity.  If you copy a single file (explicit, no wildcards)
and the
> destination is assumed to be a file unless the final \ is stated
explicitly
> (after all, you _can_ have a file name that has no extension).

> Other than all the obvious reasons for the "permission denied" already
posted,
> this is one that happens when the lack of the backslash causes the copy or
> copyfile method to assume the destination is a filename and fails because
the
> name already exists as a folder.

> --
> Michael Harris



> | The file system object has 2 copy methods. One is oFS.CopyFile(Source,
> | Destination) where oFS is a filesystem object, and the other is
> | oFile.Copy(Destination)where oFile is a File object(for example For
> | Each oFile in oFolder... ). I have had this problem with one in the
> | past and solved it by using the other. I never got to the bottom of why
> | one should work and not the other - I suppose once I get something to
> | work I normally just move on.
> |
> | This is probably no help, but it's a suggestion.
> |
> | Sen Hennessy
> |
> |


> | > I have deleted the file, rebooted and try running the script again.
> | It
> | > still gives me the same error.  But if I tell it drop it in a
> | different
> | > directory, all works fine.  I can manunally copy the files needed.  I
> | dunno,
> | > probably something screwed in my script
> | >


> | > > Have you also eliminated the "in-use" possibility???
> | > >
> | > > --
> | > > Michael Harris
> | > >
> | > >


> | > > | I have the orverwrite option set to True and the file is not read
> | only,
> | > > but
> | > > | I get the same error.
> | > > |
> | > > |


> | > > | > If you copy without setting the overwrite option to True and the
> | > target
> | > > | file
> | > > | > is marked read-only
> | > > | > Or
> | > > | > the target file is in-use
> | > > | >
> | > > | > you'll get the "Access Denied" message.
> | > > | >
> | > > | > --
> | > > | > Michael Harris
> | > > | >
> | > > | >

> | message

> | > > | > | Hi everybody
> | > > | > |
> | > > | > | I am getting access denied when I am trying to copy a file
> | from a
> | > > | network
> | > > | > | share to the local machine.  All of the permissions are set
> | correct.
> | > > I
> | > > | > | don't know what is going on.  I am using the
> | > > | > | Wscript.CreateObject("Scripting.FileSystemObject") and still
> | no
> | > bueno.
> | > > | > Any
> | > > | > | thoughts?
> | > > | > |
> | > > | > |
> | > > | > | --
> | > > | > | Seth Fraundorf, MCP+I, MCSE
> | > > | > | Internet Developer/LAN/WAN Technician

> | > > | > | ----------
> | > > | > | If you want to reply by email, take out the no-spam
> | > > | > | ---------
> | > > | > |
> | > > | > |
> | > > | > |
> | > > | >
> | > > | >
> | > > |
> | > > |
> | > >
> | > >
> | >
> | >
> |
> | --
> | Sen Hennessy
> | Two Dots Ltd.
> |
> |
> | Sent via Deja.com http://www.deja.com/
> | Share what you know. Learn what you don't.



Sat, 08 Dec 2001 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Access denied when I try to launch an exe file

2. File copying -- Permission denied

3. Permission Denied when copying a file to the SendTo folder

4. Copy file over network : Permission Denied

5. Permission denied when copying a file

6. copying files and I get acces denied...

7. Access denied writing XML file from Javascript

8. access to specified device or file is denied

9. Access denied (JavaScript error) while download a file.

10. Access denied once the file field is filled

11. type=file access denied

12. "Access denied" when accessing script object

 

 
Powered by phpBB® Forum Software