Re: Shell Functions and DOS executables
- From: "Lance Wynn" <LanceWynn@xxxxxxxxxxxxxxxx>
- Date: Fri, 20 Jan 2006 20:21:50 -0700
Click: Project --> References and then select Windows Script Host Object
Model from the reference list.
"VB_Newby" <VB_Newby@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43d192b4$0$51452$892e7fe2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> "VB_Newby" <VB_Newby@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:43c05173$0$72436$892e7fe2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>> <Re-ordered for clarity>
>>
>> I'm running a DOS executable from a VB Shell function.
>>
>> If it's successful, it looks like this (at the DOS prompt):
>> cnvrtwfm -l tek00001.wfm
>> Creating tek00001.dat
>>
>>It it's unsuccessful, it looks like this (at the DOS prompt):
>> cnvrtwfm -l tek00001.wfm
>> Error Converting tek00001.wfm
>>
>> How can I retrieve the command line output of a Shell'ed DOS
>> executable?
> Lance Wynn said:
> Hello,
> Something along these lines may work for you.
> (Make a reference in your project to the "Windows Script Host
> Object Model")
>
> Dim wsh As IWshRuntimeLibrary.WshShell
> Dim wshExec As IWshRuntimeLibrary.wshExec
> Dim results as string
> Set wsh = New WshShell
> Set wshExec = wsh.Exec("c:\test.bat")
> results = wshExec.StdOut.ReadAll
Can someone further elaborate on how to integrate this into my VB
program. I don't know how to "make a reference to a Windows Script
Host Object Model". I'm just above clueless... but learning. ;-D
(I tried redirecting the DOS command output via ">" but for some
reason this silly DOS program won't be redirected to a file.)
.
- Follow-Ups:
- Re: Shell Functions and DOS executables
- From: VB_Newby
- Re: Shell Functions and DOS executables
- References:
- Shell Functions and DOS executables
- From: VB_Newby
- Re: Shell Functions and DOS executables
- From: Lance Wynn
- Re: Shell Functions and DOS executables
- From: VB_Newby
- Shell Functions and DOS executables
- Prev by Date: Re: Writing to registry
- Next by Date: Re: UDT in Collection
- Previous by thread: Re: Shell Functions and DOS executables
- Next by thread: Re: Shell Functions and DOS executables
- Index(es):
Relevant Pages
|