Prev: VB 6.0 with MSXML2.DOMDocument; How to access apache http with credentials
Next: User Defined Data Type --- Please HELP!!!!
From: sturkel on 19 Oct 2007 06:38 I want to run a commandline tool from vb. It searches for some information in a database and returns it to the commanline (I guess stdout) Running an application from vb is not the issue, but I don't know how to read the commandline output. Can someone give me an example in VB6.0 (SP5) Thanks in advance
From: Phill W. on 19 Oct 2007 07:42 sturkel wrote: > I want to run a commandline tool from vb. > Running an application from vb is not the issue, but I don't know how > to read the commandline output. Your best bet is probably to use the DOS shell to redirect the output from that tool into a file, then read that file back into VB. ChDir "drv:\dir1\dir2" Shell "cmd /c 'program.exe > file.txt' " ' wait for it to finish, then ... Dim iFile as Integer: iFile = FreeFile() Open "drv:\dir1\dir2\file.txt" for Input as #iFile Dim sData as String: sData _ = Input( LOF(iFile), #iFile ) Close #iFile HTH, Phill W.
From: sturkel on 19 Oct 2007 13:16 On 19 okt, 13:42, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k> wrote: > sturkel wrote: > > I want to run a commandline tool from vb. > > Running an application from vb is not the issue, but I don't know how > > to read the commandline output. > > Your best bet is probably to use the DOS shell to redirect the output > from that tool into a file, then read that file back into VB. > > ChDir "drv:\dir1\dir2" > Shell "cmd /c 'program.exe > file.txt' " > > ' wait for it to finish, then ... > > Dim iFile as Integer: iFile = FreeFile() > Open "drv:\dir1\dir2\file.txt" for Input as #iFile > Dim sData as String: sData _ > = Input( LOF(iFile), #iFile ) > Close #iFile > > HTH, > Phill W. Is there no direct interaction with the output of a command? I know that I can put it to a file, but I prefer the other way.
From: Randy Birch on 19 Oct 2007 15:38
Not really. If it can be done, L.J. will have the means on his site - http://www.mvps.org/st-software/ -- Randy http://vbnet.mvps.org/ "sturkel" <sturkel(a)gmail.com> wrote in message news:1192814183.479759.204240(a)q3g2000prf.googlegroups.com... > On 19 okt, 13:42, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k> > wrote: >> sturkel wrote: >> > I want to run a commandline tool from vb. >> > Running an application from vb is not the issue, but I don't know how >> > to read the commandline output. >> >> Your best bet is probably to use the DOS shell to redirect the output >> from that tool into a file, then read that file back into VB. >> >> ChDir "drv:\dir1\dir2" >> Shell "cmd /c 'program.exe > file.txt' " >> >> ' wait for it to finish, then ... >> >> Dim iFile as Integer: iFile = FreeFile() >> Open "drv:\dir1\dir2\file.txt" for Input as #iFile >> Dim sData as String: sData _ >> = Input( LOF(iFile), #iFile ) >> Close #iFile >> >> HTH, >> Phill W. > > Is there no direct interaction with the output of a command? > I know that I can put it to a file, but I prefer the other way. > |