Discussion:
List all *.jpg files in computer
(too old to reply)
GARYWC
2016-02-02 16:25:50 UTC
Permalink
The Windows Command Prompt, shows:

C:\>

when I type:

dir /s *.jpg >listjpg.txt

why am I'm getting an ACCESS DENIED message?


(I'm running Windows 7)
R.Wieser
2016-02-02 18:08:07 UTC
Permalink
Gary,
Post by GARYWC
why am I'm getting an ACCESS DENIED message?
Maybe you are, as a standard user, not allowed to write into C:\ (the root
folder) ?

Try this :

echo Test > listjpg.txt

If it also returns that error you do not have the rights. In that case
write to your own personal temp-files folder. Like this:

dir /s *.jpg >%temp%\listjpg.txt

By the way: also check out the "/b" option:

dir /s /b *.jpg >%temp%\listjpg.txt

It outputs the full path of the found file.

Hope that helps.

Regards,
Rudy Wieser
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
Paul
2016-02-02 18:33:39 UTC
Permalink
Post by R.Wieser
Gary,
Post by GARYWC
why am I'm getting an ACCESS DENIED message?
Maybe you are, as a standard user, not allowed to write into C:\ (the root
folder) ?
echo Test > listjpg.txt
If it also returns that error you do not have the rights. In that case
dir /s *.jpg >%temp%\listjpg.txt
dir /s /b *.jpg >%temp%\listjpg.txt
It outputs the full path of the found file.
Hope that helps.
Regards,
Rudy Wieser
There are a couple places for output

dir /s *.jpg > %temp%\listjpg.txt
dir /s *.jpg > %userprofile%\Downloads\listjpg.txt

And if a person wants to understand those locations,
they can click in the bar at the top of the File Explorer
window and enter

%temp%
%userprofile%

and get the File Explorer to "expand" the variables. That
way, it makes it easier to locate the output later.

And if you look at "shortcut" icons on your system,
you do "Properties" on them and look at their
construction, some use double-quotes to prevent
a space character in the path name from screwing
up. It may not happen in this case, but if the
file ends up in the wrong place, you could
try something like this.

dir /s *.jpg > "%userprofile%\Downloads\listjpg.txt"

The most likely place for that to screw up, is if
I write my own C program, and it receives a path
specification, and improperly treats it as two
separate text strings. So if you get a "rotten surprise",
you can try to use the double-quote characters
as an insulation mechanism on a future invocation.
My %userprofile% has a space between my first name
and my last name.

Paul
Micky
2016-02-02 18:55:11 UTC
Permalink
[Default] On Tue, 2 Feb 2016 08:25:50 -0800 (PST), in
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
Because you're a punk and you don't deserve any access at all.

Well, I tried exactly what you have above in Vista Business and it
took quite a while with nothing happening on the screen, but it did
write a 340K file with 6400 lines, including summary lines every time
the directory changed.

I guess I'm more of a man than you are.
Post by GARYWC
(I'm running Windows 7)
Kerr Mudd-John
2016-02-03 11:53:04 UTC
Permalink
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
you don't have read access to some subfolders, or (more likely) you don't
have write access to the current folder.
--
Bah, and indeed, Humbug
g***@aol.com
2016-02-03 16:43:22 UTC
Permalink
Post by Kerr Mudd-John
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
you don't have read access to some subfolders, or (more likely) you don't
have write access to the current folder.
You can break that tie by trying it without piping the results to a
file. See if you can just list them.
On my old XP machine you also may have to go into tools/folder options
and uncheck "hide system files" and check "show hidden files"

This does point out the advantage of only keeping programs and system
files in the C: partition and putting your "data" on D: or some other
drive.
mike
2016-02-04 08:48:41 UTC
Permalink
Post by Kerr Mudd-John
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
you don't have read access to some subfolders, or (more likely) you
don't have write access to the current folder.
home or pro?
Are you an administrator?
Did you open the command prompt with "run as administrator"?

Remove the redirect and write to the display.
That will tell you if it's a read or write issue.
If the display is correct, change the redirect to a place
to which you do have write permission.

I can't test the read issue for you because I take
ownership of the whole damn drive on my systems.
Your command works fine on mine.
Paul
2016-02-04 09:09:07 UTC
Permalink
Post by mike
Post by Kerr Mudd-John
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
you don't have read access to some subfolders, or (more likely) you
don't have write access to the current folder.
home or pro?
Are you an administrator?
Did you open the command prompt with "run as administrator"?
Remove the redirect and write to the display.
That will tell you if it's a read or write issue.
If the display is correct, change the redirect to a place
to which you do have write permission.
I can't test the read issue for you because I take
ownership of the whole damn drive on my systems.
Your command works fine on mine.
Did you actually do that on C: ?

I'm interested.

Does Windows Update still work ?

Can you install a program in Program Files as normal ?

Paul
mike
2016-02-04 13:54:04 UTC
Permalink
Post by Paul
Post by mike
Post by Kerr Mudd-John
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
you don't have read access to some subfolders, or (more likely) you
don't have write access to the current folder.
home or pro?
Are you an administrator?
Did you open the command prompt with "run as administrator"?
Remove the redirect and write to the display.
That will tell you if it's a read or write issue.
If the display is correct, change the redirect to a place
to which you do have write permission.
I can't test the read issue for you because I take
ownership of the whole damn drive on my systems.
Your command works fine on mine.
Did you actually do that on C: ?
I'm interested.
If I look at permissions for c:, all the checkboxes
in effective permissions are checked. The drive is still
owned by trustedinstaller. I think I actually
took ownership in only those places where it wouldn't let me
change permissions.

On this system, I am the owner of Program Files.
I didn't change anything that
should reduce the ability of the system to do its thing. Seems to work.
Post by Paul
Does Windows Update still work ?
Windows update has been disabled since day one via the
standard MS GUI interface.
Post by Paul
Can you install a program in Program Files as normal ?
Most installers put programs in Program Files. Problem I had
was that sometimes you needed to put additional .dlls in
the program directory to enable additional functionality.
Taking ownership (and permissions) allowed that.
When it comes to forcing
the OS out of my way, I tend to use the chainsaw rather
than the scalpel.

That's one of my pet peeves with linux. It's always asking me
for a password. I have not yet discovered the inner chainsaw. ;-)
Post by Paul
Paul
Paul
2016-02-04 17:32:18 UTC
Permalink
Post by mike
Post by Paul
Post by mike
Post by Kerr Mudd-John
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
you don't have read access to some subfolders, or (more likely) you
don't have write access to the current folder.
home or pro?
Are you an administrator?
Did you open the command prompt with "run as administrator"?
Remove the redirect and write to the display.
That will tell you if it's a read or write issue.
If the display is correct, change the redirect to a place
to which you do have write permission.
I can't test the read issue for you because I take
ownership of the whole damn drive on my systems.
Your command works fine on mine.
Did you actually do that on C: ?
I'm interested.
If I look at permissions for c:, all the checkboxes
in effective permissions are checked. The drive is still
owned by trustedinstaller. I think I actually
took ownership in only those places where it wouldn't let me
change permissions.
On this system, I am the owner of Program Files.
I didn't change anything that
should reduce the ability of the system to do its thing. Seems to work.
Post by Paul
Does Windows Update still work ?
Windows update has been disabled since day one via the
standard MS GUI interface.
Post by Paul
Can you install a program in Program Files as normal ?
Most installers put programs in Program Files. Problem I had
was that sometimes you needed to put additional .dlls in
the program directory to enable additional functionality.
Taking ownership (and permissions) allowed that.
When it comes to forcing
the OS out of my way, I tend to use the chainsaw rather
than the scalpel.
That's one of my pet peeves with linux. It's always asking me
for a password. I have not yet discovered the inner chainsaw. ;-)
Post by Paul
Paul
On Windows 7, you can record permissions and reload them after surgery.
For any DLLs you added to a Program Files, there would be no recorded
permissions for those, so they wouldn't match the other files
in the folder in question.

http://dandar3.blogspot.ca/2013/01/how-to-ntfs-compress-windows-winsxs.html

For Linux, if you install the OS on a hard drive, sudo prompts
for a password. On the other hand, using a LiveCD, sudo doesn't
prompt for a password. I don't know if the password is blank
on a LiveCD and that makes a difference, or there is an actual
active method to preventing it from prompting (gksu?).

Paul
mike
2016-02-04 22:59:38 UTC
Permalink
Post by Paul
Post by mike
Post by Paul
Post by mike
Post by Kerr Mudd-John
Post by GARYWC
C:\>
dir /s *.jpg >listjpg.txt
why am I'm getting an ACCESS DENIED message?
(I'm running Windows 7)
you don't have read access to some subfolders, or (more likely) you
don't have write access to the current folder.
home or pro?
Are you an administrator?
Did you open the command prompt with "run as administrator"?
Remove the redirect and write to the display.
That will tell you if it's a read or write issue.
If the display is correct, change the redirect to a place
to which you do have write permission.
I can't test the read issue for you because I take
ownership of the whole damn drive on my systems.
Your command works fine on mine.
Did you actually do that on C: ?
I'm interested.
If I look at permissions for c:, all the checkboxes
in effective permissions are checked. The drive is still
owned by trustedinstaller. I think I actually
took ownership in only those places where it wouldn't let me
change permissions.
On this system, I am the owner of Program Files.
I didn't change anything that
should reduce the ability of the system to do its thing. Seems to work.
Post by Paul
Does Windows Update still work ?
Windows update has been disabled since day one via the
standard MS GUI interface.
Post by Paul
Can you install a program in Program Files as normal ?
Most installers put programs in Program Files. Problem I had
was that sometimes you needed to put additional .dlls in
the program directory to enable additional functionality.
Taking ownership (and permissions) allowed that.
When it comes to forcing
the OS out of my way, I tend to use the chainsaw rather
than the scalpel.
That's one of my pet peeves with linux. It's always asking me
for a password. I have not yet discovered the inner chainsaw. ;-)
Post by Paul
Paul
On Windows 7, you can record permissions and reload them after surgery.
For any DLLs you added to a Program Files, there would be no recorded
permissions for those, so they wouldn't match the other files
in the folder in question.
http://dandar3.blogspot.ca/2013/01/how-to-ntfs-compress-windows-winsxs.html
Thanks for the interesting link. Procedures like that are the primary
reason I don't like desktop linux. I'm not about to do it in windows ;-)
Post by Paul
For Linux, if you install the OS on a hard drive, sudo prompts
for a password. On the other hand, using a LiveCD, sudo doesn't
prompt for a password. I don't know if the password is blank
on a LiveCD and that makes a difference, or there is an actual
active method to preventing it from prompting (gksu?).
Even if you could do without a password, that opens up other
cans of worms relative to network permissions.
You can add yourself to the sudoers group or permission list or
something. That helps with the sudo stuff, but not the zillion
other things that require a password to proceed.

Problem is that there is no such thing as desktop linux. It's a random
assignment of stuff called a distro. And determining exactly how to
do anything on this version of that distro with the other desktop manager
is difficult for the newbie.

I've been messing with linux since it came on a single floppy.
I have yet to reach critical mass of stuff that works on a single
distro to make it a viable alternative to windows for those of us
who don't want to become a guru.
Not allowing logins as root was a step backwards.
First thing I do in a command prompt is sudo -i
I recently discovered gksu. In order to copy library files
I have to open a command prompt, run gksu to get nautilus to open,
run it again for another instance just so I can use the GUI to
drag/drop a damn file.

I'll shut up now. This is the wrong group for another linux rant.
Post by Paul
Paul
Continue reading on narkive:
Loading...