[AccessD] Running a Dir command from within Access vba

jack drawbridge jackandpat.d at gmail.com
Sun Mar 12 12:58:43 CDT 2017


Thanks Rocky.
I've been googling and now think I need a bat file.

I have to change Directories, run the Dir with parameters and then output
the result to a file.

Testing as I type.

jack

On Sun, Mar 12, 2017 at 1:41 PM, Rocky Smolin <rockysmolin at bchacc.com>
wrote:

> Jack:
>
> I use
>
> strFilename = Dir$(varFolder & "\*.jpg")
>
> where varFolder is returned from a folder picker function,
>
> then iterate through the file names by:
>
> Do while strFilename<>""
> .
> .
> .
> Stuff.
> .
> .
>         strFilename = Dir
>
> loop
>
> HTH
>
> Rocky
>
>
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> jack drawbridge
> Sent: Sunday, March 12, 2017 9:52 AM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Running a Dir command from within Access vba
>
> Hi again,
>
> Does anyone have sample vba to run a Dir command?
> I'm trying to get a listing of all *.jpg files from a directory and its
> subdirectories and put the list in a text file in a specific directory.
>
> I can get this to work going to command prompt and entering the string
> directly, but I want to do this from inside Access.
>
> cd  \users\mellon\documents\testImages Dir \s\b *.jpg >MyJpgs.txt
>
> Thanks,
> jack
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list