Dos Command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to run dir e:\ *.xls /b/s > e:\fdirdata.txt within access.

I am not having much sucess.

Please help
 
Try

Shell "command.com /c dir e:\*.xls /b/s >e:\fdirdata.txt"

Shell is a VBA function that allows you to run external programs, in this
case command.com. The /c switch tells command.com to run the specified
command, in this case the dir command, then exit.
 
Wayne thanks for reply. However the file has be shortended with ~ how can I
get full file & directory names

Thanks for your help
 
If you're using a Windows NT computer (this includes Win2k and WinXP) then
use cmd.exe instead of command.com. You can also use the VBA Dir() function
and the VBA file manipulation functions to write your own file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top