Sign in with
Sign up | Sign in
Your question
Closed

Access Denied

Tags:
  • External Hard Drive
  • Windows 7
Last response: in Windows 7
Share
December 31, 2010 3:10:06 PM

Hello,

I am trying to create a simple text file listing the contents of a external hard drive diretory - to wit:

dir g:\moviearchives > movielist-g.txt

which I intended to replace an existing file of the same name in the same location.

But I get the response "Access is denied"

Could you please help me understand how I could produce such a text file? It has worked in the past, but now won't.

Thank you, Rich

More about : access denied

a c 209 $ Windows 7
December 31, 2010 3:25:01 PM

First of all, I assume you're typing this into a Command Prompt window? What does the prompt say (this is usually the default folder where the output file would be written to). Can you access that folder using Windows Explorer?

What about the "g:\moviearchives" folder - can you view it using Windows Explorer?

If you can't view the folders with Windows Explorer, then there may be some sort of permissions problem with it.
Score
0
December 31, 2010 3:46:13 PM

Sorry, I just assumed that would be understood on this forum. My bad. And apologies for not being clearer.

Yes - I am typing in the Command Prompt window.

The prompt says just what I put in my original question. Here's the whole thing for clarification:

C:\dir g:\moviearchives\ > movielist-g.txt
Access is denied.

Yes, I can access the "g:\moviearchives" folder and view it using Windows Explorer with no problems whatsoever.

In fact, more than that, if I type in
dir g:\moviearchives
it will print the entire directory list in the DOS box. It just won't create the TXT file.

It did it fine just a few days ago.
Score
0
Related resources

Best solution

a c 209 $ Windows 7
December 31, 2010 7:10:34 PM

So it looks like your default directory is "C:\dir" ? Can you view that directory in Windows Explorer, and can you right-click and create a new text file in it?
Share
December 31, 2010 7:22:43 PM

Hello?! "dir" is a DOS command. It is the DOS shorthand command for directory.

While I appreciate the attempt to help, and no intention of being unkind, but if you don't know about DOS commands, I doubt you're going to be able to help me. You're wasting both your time and mine. No offense intended.

Thanks anyway for the attempt.

Anyone else reading this know how to successfully direct DOS to print out a list of files in a directory into a text file?

It did work at one point but now the exact same command is producing the "Access is denied" response (see my above postings).
Score
0
December 31, 2010 7:37:29 PM

Hey man, I have done this quite a few times in the past, cataloging music and whatnot, just tried it again after reading your post. A couple of questions:

What OS are you running?
Can you create/write/delete files from "c:\"? Only reason i ask, is obviously, that is where the "movielist-g.txt" is being created. Humor me, and go create a text file there through windows explorer and see what happens.

If you are running windows 7, try running command prompt as administrator (find your cmd.exe and right click, run as administrator) then try again. Dont know that this will solve anything, as it seems like a directory rights issue.

Can you perform the task in a different directory? Something like...
\users\%username%\desktop\dir g:\whatever\ > whatever.txt
where that directory would absolutely be owned by the currently logged in user, thus having all appropriate rights.

-l
Score
0
December 31, 2010 8:15:08 PM

lukin,

The system is Win7 Home Premium.

I just knew it was going be something easy. But DOS can be so unforgiving and so damn literal that if something is missing a space (or includes an unwanted space), it will refuse to do one's bidding.

The idea of running the CMD under Administrator did the job. The weird part is that it would work fine one time and the next it wouldn't - the erratic part was driving me nuts. I'll just run it under Admin in the future.

Thanks much - now I have my list of movies. Greatly appreciate your stepping in here.

Rich
Score
0
December 31, 2010 8:16:03 PM

Best answer selected by Abinadi7.
Score
0
December 31, 2010 8:20:57 PM

No problem man! Glad I could help. Kinda confused on your best answer chosen selection though....
Score
0
December 31, 2010 9:00:41 PM

Heh, heh. I thought this would happen., but wasn't sure you would see it. Oh well ...

A neighborhood kid was at my computer and clicked on the wrong icon (I have four screens working).

So my apologies - the one selected (incorrectly) was not the best answer.

It's pretty lame that one cannot change that setting once it is made. Not user friendly at all.

Mea culpa.

Rich
Score
0
January 1, 2011 12:05:56 PM

Windows 7 does not allow non admin to create a file in the root of c:\ without elivated admin.

A second solution is to create a directory on the c:\ called LIST (or any other name). and then from the command prompt run
C:\dir g:\moviearchives\ > c:\list\movielist-g.txt
orther options are to use a /b swith on the end to only list the file names with no header or footer info e.g.

'dir d:\movies\ >d:\list\movies.txt' outputs
**Start**
Volume in drive D is Data
Volume Serial Number is 0C8E-CF37

Directory of d:\movies

01/01/2011 14:01 <DIR> .
01/01/2011 14:01 <DIR> ..
01/01/2011 13:58 0 Christmas 09.avi
01/01/2011 13:58 0 Christmas 10.avi
01/01/2011 13:58 0 Rob B-Day 08.avi
01/01/2011 13:58 0 Rob B-Day 09.avi
01/01/2011 13:58 0 Rob B-Day 10.avi
5 File(s) 0 bytes
2 Dir(s) 99,143,290,880 bytes free
**End**
While 'dir d:\movies\ >d:\list\movies.txt' outputs
**Start**
Christmas 09.avi
Christmas 10.avi
Rob B-Day 08.avi
Rob B-Day 09.avi
Rob B-Day 10.avi
**End**
Score
0
a c 209 $ Windows 7
January 1, 2011 4:37:42 PM

Abinadi7 said:
Hello?! "dir" is a DOS command. It is the DOS shorthand command for directory.
Ah, so what you meant to say was that the prompt looked like this:

C:\>

...and then you typed "dir".

That's what I was trying to establish when I asked what the prompt was - in this case it was telling you that the default folder was "C:\", which, as hollett says, is protected against writes. Since your command didn't specifically identify which folder to put the output in, that's where it tried to write it.
Score
0
October 12, 2011 9:15:17 PM

sminlal said:
Ah, so what you meant to say was that the prompt looked like this:

C:\>

...and then you typed "dir".

That's what I was trying to establish when I asked what the prompt was - in this case it was telling you that the default folder was "C:\", which, as hollett says, is protected against writes. Since your command didn't specifically identify which folder to put the output in, that's where it tried to write it.



You are lucky the neighborhood kid selected your answer, since it is probably the only one you will ever get.

If his prompt pointed to the directory "dir", it would have looked like: C:\dir>
He clearly showed it as: C:\>dir

So, just go away and let someone else answer. Even you might learn something.
Score
0
a c 424 $ Windows 7
October 12, 2011 9:19:49 PM

This topic has been closed by Area51reopened
Score
0
!