Shell Command Doesn't Create TXT file as expected



Hi All,

I am having problems using the shell command to write the output of a dos
command to a text file.

I would be really grateful if someone could tell me why this doesn't produce
the required Test.txt file?

Sub Test

Shell ("dir >C:\test.txt")

End sub

I get the error "File Not Found"

What is the correct syntax to write a dos command to a file using Shell?

Thanks

Andy


.



Relevant Pages

  • Re: Executing DOS Commands from Access VBA
    ... Run the command at the DOS ... an alternative is to create a batch file and use the shell command to run ... specified folder after the operation completes. ...
    (microsoft.public.access.modulesdaovba)
  • Re: VB6 and Shell
    ... Can't tell for sure from your description, but if the shell command ... I'd use VB to call a batch file that calls the command. ... The shell command seems to run the external program asychronously as you ... Is there away to leave the DOS box open to ...
    (microsoft.public.vb.general.discussion)
  • Re: Shell Command Doesnt Create TXT file as expected
    ... > I am having problems using the shell command to write the output of a dos ... > command to a text file. ... > Sub Test ... > What is the correct syntax to write a dos command to a file using Shell? ...
    (microsoft.public.vb.general.discussion)
  • Re: DOS / XP bat file programming question
    ... How do I feed a "y" response to a DOS command that wants to prompt me ... Note that DOS is an operating system, same as Windows XP. ... There is no DOS under Windows, only a Command Prompt. ...
    (microsoft.public.windowsxp.general)
  • Re: Master Boot Record
    ... Is the DOS program relating to the commands which you mentioned in your ... > If you don't know why you'd want to restore or backup a boot sector then don't do it. ... It also contains the partition table. ... The LOCK command enables direct disk access by programs ...
    (microsoft.public.windowsxp.general)