|
-
Jul 18th, 2000, 09:14 AM
#1
Thread Starter
Fanatic Member
a few days ago I asked how to run a dos command in VB
I got this answer but it won't work
cmd = "cmd /c dir > " & app.path & "\dosresult.txt"
so I run
Shell "ping 192.0.0.1 /c dir > c:\test.txt"
or
Shell "NSLOOKUP /c dir > c:\test.txt"
and it doesn't do anything
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Jul 18th, 2000, 10:24 AM
#2
Hyperactive Member
Hi,
It's the outputting to a file it doesn't like.
Create a batchfile that runs the command and shell to this.
Then you can access the output file.
Regards
Chris
-
Jul 18th, 2000, 10:31 AM
#3
Thread Starter
Fanatic Member
Sorry,
I don't know what a batch file is!
Please Advice
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Jul 18th, 2000, 10:34 AM
#4
Lively Member
Batch file is just a file with the ".BAT"
put this in a file
ping 192.0.0.1 /c dir > c:\test.txt
and call the file test.bat
then run shell "c:\test.bat" from VB
VB 6 Professional Edition
-
Jul 18th, 2000, 11:58 AM
#5
Thread Starter
Fanatic Member
Got IT
Thanks a Billion!!!
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Jul 18th, 2000, 12:02 PM
#6
Thread Starter
Fanatic Member
Another question
How Can I do a multiple command like
nslookup
set type=mx
yahoo.com
Kurt Simons
[I know I'm a hack but my clients don't!]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|