473,513 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
2 3468
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2943
by: shoo | last post by:
Any one know how to do this? thank Write a simple text-formatting program that produces neatly printed output from input text containing embedded command lines that determine how to format the...
0
2799
by: ivan | last post by:
Access97 While in ADD mode- I have a command button that has the following: DoCmd.Printout acSelection This command gives me an error message (after it prints), that there is not enough...
0
1511
by: Owen Jenkins | last post by:
I use the DoCmd.Printout method to print reports using the client's default options This has worked fine for years with Access 97 and 2000/2, Win95-XP. However two clients have recently complained...
3
4099
by: RC | last post by:
I am using docmd.printout to send Reports (formatted as labels) to a barcode label printer. I need to collate the labels so that I print lable 1 twice, then label 2 twice, then label 3 twice, etc....
4
2033
by: veereshai | last post by:
i want to copy the functions from my source file into a new file...and convert each function into a new object file by compiling it. now, i want to invoke the function using the object file i have...
17
4791
by: MLH | last post by:
From time to time, I find myself cross checking one block of code against another. Usually older stuff in which I've made modifications that don't work. I don't remember what all the changes were...
2
2946
by: Zeya | last post by:
I have an application where I am required to run a full text query. My database is MySQL and code in C#. The way all queries are SELECT * FROM table WHERE firstname = ? and using command...
63
3887
by: John Salerno | last post by:
I know there's a request for a good IDE at least once a week on the ng, but hopefully this question is a little different. I'm looking for suggestions for a good cross-platform text editor (which...
7
4619
by: TC | last post by:
I've produced an Access application for a client. For one report, text gets cut-off at the right margin when we print the report. It does this only when we print; it doesn't happen when we view the...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5089
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.