Access Shell (1 Viewer)

jdraw

Super Moderator
Staff member
Local time
Today, 18:36
Joined
Jan 23, 2006
Messages
13,400
If you know the drives involved, you can probably adapt this to suit your needs. It runs from the command prompt and is very quick.

I use this approach to find and list various file types(zip in the example) and their locations to a text file, then read the text file to an Access table..


Code:
C:\Users\Jack>dir /b /s *.zip >c:\users\jack\documents\oldzips.txt
I just used this to get a listing of all zip file on my C: drive (all folders and subfolders) and put the list of full paths into the file oldzips.txt

Sample output:
C:\Users\Jack\AppData\Local\Temp\AttachDemo.zip
C:\Users\Jack\AppData\Local\Temp\database11111.zip
C:\Users\Jack\AppData\Local\Temp\demoDataMacro.zip
C:\Users\Jack\AppData\Local\Temp\Review Tracking-forum.zip
C:\Users\Jack\AppData\Local\Temp\SuperHeroes-1.zip
C:\Users\Jack\AppData\Local\Temp\SuperHeroes-2.zip
C:\Users\Jack\AppData\Local\Temp\SuperHeroes.zip
C:\Users\Jack\AppData\Roaming\Notepad++\plugins\config\PluginManagerPlugins.zip
C:\Users\Jack\Desktop\TestImportDec16.zip



You can change the *.zip to *.jpg of all your files are jpg.

Good luck.
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 23:36
Joined
Sep 21, 2011
Messages
7,114
I *think* what the o/p wants to do is to read a certain folder and for every file in that folder(s) (the picture files) create a entry in the db with a hyperlink/path to that file and show in the image control?

That is how I interpreted the request.?
 
Last edited:

MannyST

Member
Local time
Today, 18:36
Joined
May 23, 2020
Messages
42
Hi. I'm not trying to change your mind and have no problem with you continuing with your chosen course of action, but I would just like to voice my opinion regarding your comment about displaying the images in an Access form will "bog down" the process. I wasn't saying you store the images in Access, merely display them. I don't think doing so will bog down your application much. Cheers!
I see.....I invite your opions, really. I know there are a bunch of different ways of doing the same thing, depending on knowledge level or understanding. I didn't know you could display in Access....I'd like to do whatever is faster.....
 

MannyST

Member
Local time
Today, 18:36
Joined
May 23, 2020
Messages
42
If you know the drives involved, you can probably adapt this to suit your needs. It runs from the command prompt and is very quick.

I use this approach to find and list various file types(zip in the example) and their locations to a text file, then read the text file to an Access table..


Code:
C:\Users\Jack>dir /b /s *.zip >c:\users\jack\documents\oldzips.txt
I just used this to get a listing of all zip file on my C: drive and put the list into oldzips.txt

Sample output:
C:\Users\Jack\AppData\Local\Temp\AttachDemo.zip
C:\Users\Jack\AppData\Local\Temp\database11111.zip
C:\Users\Jack\AppData\Local\Temp\demoDataMacro.zip
C:\Users\Jack\AppData\Local\Temp\Review Tracking-forum.zip
C:\Users\Jack\AppData\Local\Temp\SuperHeroes-1.zip
C:\Users\Jack\AppData\Local\Temp\SuperHeroes-2.zip
C:\Users\Jack\AppData\Local\Temp\SuperHeroes.zip



You can change the *.zip to *.jpg f all your files are jpg.

Good luck.
nice, I'll play with it once I finish reading responses. Been working in between all this...
 

isladogs

CID VIP
Local time
Today, 23:36
Joined
Jan 14, 2017
Messages
14,016
If that is the case, the Folder Image Viewer app I mentioned does exactly that. See link in post #8
 

MannyST

Member
Local time
Today, 18:36
Joined
May 23, 2020
Messages
42
Sounds like you already have a table with a field that has image path (or at least just image name) stored as a text string. If not, code can loop through files of a Windows folder and grab each file path and/or name and save it into text field. Then later you can use FollowHyperlink to open that image in viewer or use Image control to view image on report or form.

I would use Image control on form. I provided you a link to thread describing how that can be done. Post #17 of that thread has specifics. Rest of that thread just has other info of interest.

If you want to provide a sample of your data, follow instructions at bottom of my post.
Yes, this is what I believe I want to do, but need to see it work.....I'm more of a show me so I can learn. What do you want as I have other tables, qry appends, scripts in the db i'm working out of. Is just the table with a make shift form I wiped together sufficient? I will figure out how to attach what I just mentioned. But yes to the above June7 of what you said....
 

June7

AWF VIP
Local time
Today, 14:36
Joined
Mar 9, 2014
Messages
3,362
I didn't know you could display in Access....I'd like to do whatever is faster.....
Really? This option has been suggested at least 4 times.

Provide at least table where you want file name saved. Companion form would be nice.
 

MannyST

Member
Local time
Today, 18:36
Joined
May 23, 2020
Messages
42
Really? This option has been suggested at least 4 times.

Provide at least table where you want file name saved. Companion form would be nice.
Well I have stated i'm a little slow more than 4 times! Maybe just the wording. Let me figure out how to send you data as I have never been on here.....
 

isladogs

CID VIP
Local time
Today, 23:36
Joined
Jan 14, 2017
Messages
14,016
Yes, this is what I believe I want to do, but need to see it work.....I'm more of a show me so I can learn.

I've already mentioned my Folder image viewer app twice without any response from you.
Have you looked at it yet? You may be able to learn from it and adapt to your needs
 

MannyST

Member
Local time
Today, 18:36
Joined
May 23, 2020
Messages
42

Users who are viewing this thread

Top Bottom