shell with dos tool output redirected to a file 
Author Message
 shell with dos tool output redirected to a file

Hello everyone :)

i can't get the output of a dos command using "shell"
the file that should be created by the dos command isnt created...
someone knows why ?
any ideas how this can be done ? this way or another ?

here is my code : (similar code works fine under QBasic but i translate it
for VB6...)

IP$ = "192.168.0.1"
TempFile = "c:\temp\Tempfile.tmp"
CMD = "ping -n 1 " & IP$ & " > " & TempFile
zou = Shell(CMD, vbHide)

any help greatly appreciated ! :o)

thanks

Tabatha,
www.kik-it.com



Tue, 08 Jul 2003 22:29:20 GMT  
 shell with dos tool output redirected to a file
Try removing the space from " > "

--

Met vriendelijke groet,

Ronald Kas


Quote:
> Hello everyone :)

> i can't get the output of a dos command using "shell"
> the file that should be created by the dos command isnt created...
> someone knows why ?
> any ideas how this can be done ? this way or another ?

> here is my code : (similar code works fine under QBasic but i translate it
> for VB6...)

> IP$ = "192.168.0.1"
> TempFile = "c:\temp\Tempfile.tmp"
> CMD = "ping -n 1 " & IP$ & " > " & TempFile
> zou = Shell(CMD, vbHide)

> any help greatly appreciated ! :o)

> thanks

> Tabatha,
> www.kik-it.com



Tue, 08 Jul 2003 23:00:10 GMT  
 shell with dos tool output redirected to a file

?CMD = "ping -n 1 " & IP$ & " > " & TempFile

CMD = Environ$("ComSpec") & " /c " & "ping -n 1 " & IP$ & " > " & TempFile

--
Paul Marshall



Wed, 09 Jul 2003 00:10:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Probs with redirecting output of a shell started DOS-App to a file

2. Redirected Output From DOS Shell In Visual Basic 6

3. Redirecting output from a SHELLed DOS Box

4. using shell to exec dos app and redirect it's output

5. Copy FTP - SHELL DOS BOX OUTPUT TO FILE

6. Redirecting the output of a DOS application to my .NET application

7. VB: How do I redirect (capture) a dos-prompt's output

8. Help - redirect DOS output?

9. Redirecting DOS output

10. Redirecting output of MS-DOS executables to VB ???

11. Redirecting the dos printer output to a buffer.

12. Redirect Dos box output

 

 
Powered by phpBB® Forum Software