Alan Searle wrote:[color=blue]
> Hi Br@dley,
>
> Yes, I have been using dir() but want to retrieve a whole directory
> tree and have found that there is a rather neat MS-DOS one-liner that
> will do all the leg-work for me. This is ...
>
> dir c:\mydir /a:d /b /s>dirs.txt
>
> i.e. it will throw the whole directory tree for the base directory
> c:\mydir out to the text file dirs.txt.
>
> If I can get it to run from VBA, then it will save me a lot of coding.
> All I need to know is how to call DOS from VBA: the shell() command
> doesn't seem to work.
>
> Or maybe you know of a better/simplier way for 'grabbing' full
> listings of directory trees in VBA?
>
> Many thanks,
> Alan.[/color]
Not sure if this will help....
My guess would be to use the FileSystem object.
http://www.mcse.ms/archive147-2004-6-818078.html
http://pubs.logicalexpressions.com/p...cle.asp?ID=410
[color=blue]
> Br@dley schrieb:[color=green]
>> Alan Searle wrote:
>>[color=darkred]
>>> I would like to run an MS-DOS command from Access (VBA) in order to
>>> read a directory tree (into an external file). The command works OK
>>> from the command (DOS) window (in XP) but I can't seem to get it to
>>> work from MS-Access (2003). I tried a simplified command, DIR, but
>>> also this wouldn't work.
>>>
>>> I have been using the following syntax:
>>>
>>> Shell("DIR")
>>>
>>> ... which is maybe wrong?
>>>
>>> I'm sure that this is a simple thing and am hoping that someone out
>>> there can give me a quick tip?
>>>
>>> Many thanks,
>>> Alan Searle[/color]
>>
>>
>> Can't you use repeated calls to Dir() ?[/color][/color]
--
regards,
Br@dley