Re: Shell Command Doesn't Create TXT file as expected
- From: Duane Bozarth <dpbozarth@xxxxxxxxxxxx>
- Date: Tue, 06 Sep 2005 11:28:42 -0500
Andibevan wrote:
>
> 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"
Because Shell is looking for an executable of the name "dir.com" or
"dir.exe" in the path. Dir is an internal command.
> What is the correct syntax to write a dos command to a file using Shell?
Shell ("command.com /c dir > C:\temp\test.txt")
.
- Follow-Ups:
- Re: Shell Command Doesn't Create TXT file as expected
- From: J French
- Re: Shell Command Doesn't Create TXT file as expected
- References:
- Shell Command Doesn't Create TXT file as expected
- From: Andibevan
- Shell Command Doesn't Create TXT file as expected
- Prev by Date: Re: Lost VB6.0 Professional CD
- Next by Date: Re: Shell Command Doesn't Create TXT file as expected
- Previous by thread: Shell Command Doesn't Create TXT file as expected
- Next by thread: Re: Shell Command Doesn't Create TXT file as expected
- Index(es):
Relevant Pages
|
Loading