By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,285 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,285 IT Pros & Developers. It's quick & easy.

Text file printout in dos mode through VB.Net or DOS command from VB.Net

P: n/a
Hi,

I am generating a text file through vb.net and I want to give facility to my
user to take DOS base (fast) printiout of it ,

or in other words,

I want to run DOS command from my application. i.e. TYPE C:\TEST.TXT >PRN ,
How can I ?

Regards,
Hardik Shah
Feb 8 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hardik,

Using proces here one which is longer it can be one line as well.

\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = "www.google.com"
pi.WorkingDirectory = "C:\windows\system32"
'this for nt* computers
pi.FileName = "ping"
p.StartInfo = pi
p.StartInfo = pi
p.Start()
Dim sr As IO.StreamReader = p.StandardOutput
Dim sb As New System.Text.StringBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW(input))
input = sr.Read
Loop
MessageBox.Show(sb.ToString)
///

I hope this helps,

Cor
Feb 8 '06 #2

P: n/a
"Hardik Shah" <ha********@hotmail.com> schrieb:
I am generating a text file through vb.net and I want to give facility to
my
user to take DOS base (fast) printiout of it ,

or in other words,

I want to run DOS command from my application. i.e. TYPE C:\TEST.TXT >PRN
,
How can I ?


Depending on the printer you may find the article below useful:

HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>

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

Feb 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.