Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CopyFile - Permission Denied

251 views
Skip to first unread message

Heath Gregg

unread,
Nov 2, 2000, 9:23:04 PM11/2/00
to
I'm attempting to do a simple File copy using FileSystemObject.CopyFile

When I use *.file extension as the source file to copy  I don't have a problem, however if I try to specify a specific file name (e.g. test.txt) I get a Runtime Error 800A0046 - Permission Denied. Anyone have any ideas as to what I'm doing wrong??

Michael Harris

unread,
Nov 2, 2000, 10:10:53 PM11/2/00
to

If the source is an explicit file name and the destination is a folder (NOT another file name with
or without an extension), you need to include the final "\" in the name.

Otherwise it's assumed to be a file name (which is what cause the "Permission denied" error since it
already exists as a folder name) unless it ends with "\".

It's not an issue when the source includes wildcards - there the target MUST be a folder even if the
name doesn't end with "\".

--
Michael Harris
Microsoft.MVP.Scripting
--
"Heath Gregg" <Heath...@zurich.com.au> wrote in message news:3A022188...@zurich.com.au...

Heath Gregg

unread,
Nov 2, 2000, 10:22:07 PM11/2/00
to

I knew it'd be something simple like that.

Thanks

Bernd Lueth

unread,
Nov 3, 2000, 8:37:56 AM11/3/00
to
Hi,
I had a similar problem with the same error code.

My Problem was, that I had forgotten to close all files before I tried to
move them.
regards
Bernd

"Heath Gregg" <Heath...@zurich.com.au> schrieb im Newsbeitrag
news:3A022188...@zurich.com.au...

0 new messages