Home All Groups Group Topic Archive Search About
Author
27 Mar 2006 3:33 PM
ngr
I want to be able to shell to DOS to pipe the contents of something to a
file which can then be read in by VB.

Example

Shell to DOS and then run ROUTE PRINT > FRED.TXT

return to VB and then open fred.txt to do sometning with that.

My attempts have so far failed as no piped file has been generated whereas
it works directly from DOS.

Author
27 Mar 2006 2:55 PM
Peter Proost
Hi maybe you can try it with a process:

Dim psi As New ProcessStartInfo
            Dim p As New Process

            psi.FileName = "your dos program"
            psi.WorkingDirectory = "the working directory"
            psi.WindowStyle = ProcessWindowStyle.Hidden
            psi.Arguments = "the arguments for your dos command"
            p.StartInfo = psi
            p.Start()
            p.WaitForExit()

hth

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

Show quoteHide quote
"ngr" <n**@tdrd.freeserve.co.uk> schreef in bericht
news:o9ucnRBukLgqarrZSa8jmw@karoo.co.uk...
> I want to be able to shell to DOS to pipe the contents of something to a
> file which can then be read in by VB.
>
> Example
>
> Shell to DOS and then run ROUTE PRINT > FRED.TXT
>
> return to VB and then open fred.txt to do sometning with that.
>
> My attempts have so far failed as no piped file has been generated whereas
> it works directly from DOS.
>
>
>
Author
27 Mar 2006 3:26 PM
Cor Ligthert [MVP]
ngr,

You can try this one on our website

http://www.vb-tips.com/default.aspx?ID=1f8f3eaf-27a1-40d7-9e0b-23cab5aa1049

I hope this helps,

Cor

Show quoteHide quote
"ngr" <n**@tdrd.freeserve.co.uk> schreef in bericht
news:o9ucnRBukLgqarrZSa8jmw@karoo.co.uk...
>I want to be able to shell to DOS to pipe the contents of something to a
>file which can then be read in by VB.
>
> Example
>
> Shell to DOS and then run ROUTE PRINT > FRED.TXT
>
> return to VB and then open fred.txt to do sometning with that.
>
> My attempts have so far failed as no piped file has been generated whereas
> it works directly from DOS.
>
>
>
Author
27 Mar 2006 7:59 PM
Herfried K. Wagner [MVP]
"ngr" <n**@tdrd.freeserve.co.uk> schrieb:
>I want to be able to shell to DOS to pipe the contents of something to a
>file which can then be read in by VB.
>
> Example
>
> Shell to DOS and then run ROUTE PRINT > FRED.TXT
>
> return to VB and then open fred.txt to do sometning with that.
>
> My attempts have so far failed as no piped file has been generated whereas
> it works directly from DOS.

You'll have to start "cmd" (or "%COMSPEC%") instead of your application
because the '>' feature is a feature of the command shell.  You can pass the
command string to "cmd" in the command line.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>