xcopy access denied

G

Guest

I have used xcopy on a number of machines but there is one which is giving me
grief. The command I use is the same on all machines (apart form the name)
and is as follows:

xcopy /s /e /d /y c:\docume~1\username\mydocu~1
\\server01\users\username\mydocu~1

Like I said it works a treat on all apart form one. When I run it on one
machine I get the error message Access Denied Unable to create and then the
name of the destination directory. The directory exists and the particular
user has full access to it just as I set up all the others.
Any ideas?
 
S

Stefan Z Camilleri

I have used xcopy on a number of machines but there is one which is giving me
grief. The command I use is the same on all machines (apart form the name)
and is as follows:

xcopy /s /e /d /y c:\docume~1\username\mydocu~1
\\server01\users\username\mydocu~1

Like I said it works a treat on all apart form one. When I run it on one
machine I get the error message Access Denied Unable to create and then the
name of the destination directory. The directory exists and the particular
user has full access to it just as I set up all the others.
Any ideas?

Have you tried browsing to \\server01\users\username\mydocu~1 from the
xcopy source pc?
 
G

Guest

Yes I have. I even saved a test document in to that directory from the xcopy
source pc.
 
P

Pegasus \(MVP\)

Logie Bear said:
I have used xcopy on a number of machines but there is one which is giving me
grief. The command I use is the same on all machines (apart form the name)
and is as follows:

xcopy /s /e /d /y c:\docume~1\username\mydocu~1
\\server01\users\username\mydocu~1

Like I said it works a treat on all apart form one. When I run it on one
machine I get the error message Access Denied Unable to create and then the
name of the destination directory. The directory exists and the particular
user has full access to it just as I set up all the others.
Any ideas?

Why would you use 8.3 folder names? Since "My Computer"
shows you LFNs, you can never be sure that your SFNs really
correspond to the LFNs you wish to copy. This command
would be much more robust:

xcopy /s /e /d /y /c "%UserProfile%\My Documents"
"\\Server01\users\%UserName%\My Documents\"

Note the use of environmental variables where appropriate,
the /c switch and the trailing backslash at the far end of the
line.

About your actual question: I recommend that you run this
batch file, then post the contents of c:\test.txt:

@echo off
set user > c:\test.txt
net user "%UserName%" >> c:\test.txt
dir "\\Server01\users\%UserName%\My Doc*" >> c:\test.txt
dir /ah "\\Server01\users\%UserName%\My Doc*" >> c:\test.txt
cacls "\\Server01\users\%UserName%\My Doc*" >> c:\test.txt
md "\\Server01\users\%UserName%\My Documents\Test" 1>> c:\test.txt 2>>&1
 
S

Stefan Z Camilleri

Yes I have. I even saved a test document in to that directory from the xcopy
source pc.

This is just a wild guess, yet it might be your firewall that is
blocking your cmd.exe.

Try disabling your firewall and seeing if there's any change.
 
G

Guest

Still no joy - same error message . I got the SFN's from DOS anyway by
navigating to the directory in question.
The contents of the c:\test.txt file are

USERDNSDOMAIN=LBS-HQ.LOCAL
USERDOMAIN=LBS-HQ
USERNAME=dawns
USERPROFILE=C:\Documents and Settings\dawns
Volume in drive \\Server01\users is Raid 5
Volume Serial Number is 6840-39D2

Directory of \\Server01\users\dawns

27/04/2007 13:24 <DIR> My Documents
0 File(s) 0 bytes
1 Dir(s) 371,672,825,856 bytes free
Volume in drive \\Server01\users is Raid 5
Volume Serial Number is 6840-39D2

Directory of \\Server01\users\dawns

\\Server01\users\dawns\My Documents LBS-HQ\dawns:(OI)(CI)F
LBS-HQ\SBS Folder Operators:(OI)(CI)F
BUILTIN\Users:(OI)(CI)(special access:)

SYNCHRONIZE
FILE_APPEND_DATA

BUILTIN\Administrators:(OI)(CI)F
NT AUTHORITY\SYSTEM:(OI)(CI)F
CREATOR OWNER:(OI)(CI)(IO)F
BUILTIN\Users:(OI)(CI)R
BUILTIN\Users:(CI)(special access:)

FILE_WRITE_DATA
 
P

Pegasus \(MVP\)

Fine, your feedback is very informative although it does
not yet tell me what's wrong. Now please type this command,
then post c:\test.txt again. Note that I deliberately omitted
the /d switch:

xcopy /s /e /y /c "%UserProfile%\My Documents"
"\\Server01\users\%UserName%\My Documents\" > 1>c:\test.txt 2>&1

As a separate question: Did you make sure that the
"Share" permissions (as opposed to the NTFS permissions)
of \\Server01\users are set to "Full access" for everyone?
 
G

Guest

I tried that one and the files scrolled up the screen with a message at the
end saying it copied 30 files. However, when I went in to check the
destination directory it had not copied as I modified one of the files before
I run it and the last amended date had not changed. The contents of the
test.txt file is:

USERDNSDOMAIN=LBS-HQ.LOCAL
USERDOMAIN=LBS-HQ
USERNAME=dawns
USERPROFILE=C:\Documents and Settings\dawns
Volume in drive \\Server01\users is Raid 5
Volume Serial Number is 6840-39D2

Directory of \\Server01\users\dawns

27/04/2007 13:24 <DIR> My Documents
0 File(s) 0 bytes
1 Dir(s) 371,672,825,856 bytes free
Volume in drive \\Server01\users is Raid 5
Volume Serial Number is 6840-39D2

Directory of \\Server01\users\dawns

\\Server01\users\dawns\My Documents LBS-HQ\dawns:(OI)(CI)F
LBS-HQ\SBS Folder Operators:(OI)(CI)F
BUILTIN\Users:(OI)(CI)(special access:)

SYNCHRONIZE
FILE_APPEND_DATA

BUILTIN\Administrators:(OI)(CI)F
NT AUTHORITY\SYSTEM:(OI)(CI)F
CREATOR OWNER:(OI)(CI)(IO)F
BUILTIN\Users:(OI)(CI)R
BUILTIN\Users:(CI)(special access:)

FILE_WRITE_DATA
 
G

Guest

It's not erroroing on any file - it does not get that far. It simply says
access denied. Unable to create directory and then the name of the
destination directory which does exist witht he correct permissions. I tried
it with the /r switch but still no joy.
 
P

Pegasus \(MVP\)

Unfortunately you left out the most important bit in your
test - the redirection of the xcopy screen output. The following
line, taken from my previous reply, is supposted to be one
single long line, even though it may wrap around in your
newsreader.

I suggest you repeat the whole test.

xcopy /s /e /y /c "%UserProfile%\My Documents"
"\\Server01\users\%UserName%\My Documents\"
1>c:\test.txt 2>&1
 
G

Guest

This is the extract:

Access denied
Unable to create directory - \\Server01\users\dawns\My Documents
0 File(s) copied

Exactly what I get when I run my version.
 
P

Pegasus \(MVP\)

Getting a little further. Please try this:
1. Click Start / Run / cmd {OK}
2. Type these commands and report the results.
xcopy /y /h c:\nt*.* "\\Server\users\dawns\My Documents\"{Enter}
ren "\\Server1\users\dawns\My Documents" "My Docs"{Enter}
xcopy /y /h c:\nt*.* "\\Server\users\dawns\My Documents\"{Enter}

In my previous reply I wrote this:
===================
As a separate question: Did you make sure that the
"Share" permissions (as opposed to the NTFS permissions)
of \\Server01\users are set to "Full access" for everyone?
===================

You never replied to this question. It is very important that you do.
 
G

Guest

Sorry I missed that bit. Yes the share permissions are correct. As I said
previously I have done this on another twenty or so PC's (including some
yesterday) and it works fine. As for the commands you asked me to try the
results are as follows:
1. Invalid drive specification. 0 file(s) copied
2. The network path was not found
3. Invalid drive specification. 0 file(s) copied
 
P

Pegasus \(MVP\)

The error messages you report suggest that the PC
cannot locate the share \\Server\Users. You need to
go back to basics and check if
- you can ping the server
- you can ping any other machine
- you can connect to a share on some other machine
- there is a firewall somewhere that blocks you
- there is a malfunctioning network adapter (rare but can happen)
- your spelling of the server/share name is correct

If things worked on this machine before and if they don't work
now then you need to think about what happened in between.
You should also try the WinXP System Restore facility to go
back to a point before things went bad.

If this does not help and if you're convinced that the machine
is not affected by malware or by a virus then uninstalling and
reinstalling all network components might help.
 
G

Guest

Ok, thanks for your help. Maybe I will try and rejoin the PC to the domain
see if that helps.
 
G

Guest

Well I tried rejoining the machine on to the domain and still no joy -
exactly the same error.
I GIVE UP!!!
 
S

Stefan Z Camilleri

Well I tried rejoining the machine on to the domain and still no joy -
exactly the same error.
I GIVE UP!!!




...

read more »

I have not read all the posts here, since there are too many, yet once
I was having similar 'inexplicable' problems and it turned out to be a
NIC issue.

The problem in my case was two cards conflicting, the best way around
this is to test it whilst ALL other machines on the network are
powered off/or disconnected, and if that fails, swap out the NICs in
turn.

Once again, apologies if I am repeating something that was already
said, yet I don't have the time to read through all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

xcopy using batch file 4
XCOPY without prompting 2
Access is denied error 5
Using XCOPY to copy only changed files 15
xcopy 7
Batch Files 4
xCopy and Vista Profiles 12
xcopy 9

Top