|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Shell to DOSI 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. 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 -- Show quoteHide quoteProgramming 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) "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. > > > 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. > > > "ngr" <n**@tdrd.freeserve.co.uk> schrieb: You'll have to start "cmd" (or "%COMSPEC%") instead of your application >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. 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/>
which is better
Deployment without Framework? Re: Newbie needs help temporarily pausing loop How to read S.M.A.R.T. attributes in vb ? Domains Can you have more than one column in Combo Box Problem deleting rows from dataset (VS2003, VB) Dot Net Deployment Issue in Win98 help please or any coment please only letters or numbers |
|||||||||||||||||||||||