Administrator getting "access denied" - unable to create directory
When you're in an admin prompt, you have to remap the drive. You can see that you don't have a J: in your admin prompt by typing net use
(it'll say unavailable in the first column of output).
Compare that to the net use
output from a standard prompt, where you'll have "OK" in the first column.
I haven't tried this, but this technet article suggest you can have the map work by modifying the registry:
1. Click Start, type regedit in the Start programs and files box, and then press ENTER.
2. Locate and then right-click the registry subkey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.
3. Point to New, and then click DWORD Value.
4. Type EnableLinkedConnections, and then press ENTER.
5. Right-click EnableLinkedConnections, and then click Modify.
6. In the Value data box, type 1, and then click OK.
7. Exit Registry Editor, and then restart the computer.
Related videos on Youtube
John Adams
Updated on September 18, 2022Comments
-
John Adams over 1 year
As far as I can tell, I am in the Administrators group on Windows 7 Service Pack 1.
With CMD prompt pinned to my Start menu, I rightmouse and select Run as Admin and get this error on xcopy:
C:\>xcopy "C:\Users\TRA\My Documents" J:\MyDocuments1-TRA /E /I /Y /M Access denied Unable to create directory - J:\MyDocuments1-TRA 0 File(s) copied
Using Windows Explorer, I can navigate to both the C drive and the J drive (an external HD) and create New Folders and within them create new files and save content inside the file. I think the syntax on XCOPY is correct.
I am a little uncertain about wrapping the first parameter in double quotes (think that is correct). The main mystery is why access denied. Thanks.
EDIT - UPDATE: More info about external drive, etc.
There is no domain - just Windows 7 - connection to "J" drive is USB. I can dig out more info on SATA or whatever if needed. Home network only. No domain controller. I did this:
C:\>net use New connections will be remembered. There are no entries in the list. C:\> C:\>dir /al Volume in drive C is OS Volume Serial Number is 366C-7FCC Directory of C:\ 07/14/2009 01:08 AM <JUNCTION> Documents and Settings [C:\Users] 0 File(s) 0 bytes 1 Dir(s) 622,991,994,880 bytes free C:\>j: J:\>dir /al Volume in drive J is SignatureMini Volume Serial Number is 18E1-4B50 Directory of J:\ File Not Found
UPDATE: "the Big Picture" - my objective here:
I'm just trying to get a "backup" command to run once per day and copy new and/or modified files. I got this XCOPY command in a scheduled task on another Windows 7 PC working nicely. I have had mysterious problems using Windows 7 Backup facility (I guess because this is Home Premium edition and my research suggests this is not supported). Thanks for your time folks. I will press on and appreciate your suggestions/ideas.
-
Adam about 10 yearsWrapping in quotes is correct since
My Documents
has a space in it. You could also wrapJ:\MyDocuments1-TRA
in quotes, but since there is no space, it wouldn't make a difference. -
Ramhound about 10 yearsDomain or local account?
-
Nullpointer42 about 10 yearsHow is J: connected? You mention it's an external drive - is it mapped via the network? USB? eSata? Something else?
-
Debra about 10 yearsWhat file system is on J:? That is, is it one that supports long names? Otherwise, your command syntax looks correct, assuming that the directory doesn't already exist on J:. Also try creating a foldername that doesn't use "MyDocuments", i.e. perhaps "DOCS-TRA".
-
Debra about 10 yearsBTW, you don't need to do that "run as admin", unless you set ownership on J: to just that account (which seems unlikely since you said you can create files/folders on it in Explorer.) Try to just run CMD.EXE, then type J: to go to the drive, then MD "testlongdirname" and see if you can create that from the cmd prompt.
-
-
Sopalajo de Arrierez about 10 yearsthe poster said J: was an external drive, not a network mapped drive. That seems to me like a USB hard disk, pendrive or similar. Maybe he could give us further explanations.
-
Nullpointer42 about 10 years@SopalajodeArrierez Ack, missed that detail . . . good catch . . . maybe I'll get lucky and it's a NAS that he/she's referring to as an external drive ;)
-
John Adams about 10 years@SopalajodeArrierez...thank you..please see update above.