Skip to content

C# - Create TXT file & then execute cmd batch that copies the file to printer

ic ic

Asked Feb 12, 2010, 2:15 AM EST1 answer
Share
LinkedInX
Good day, I need help.
I have a print button that loops through a grid object and where it finds the print check it must do the following.
1. Create a text file on the network with object text & values in.
2. When file created then executed dos cmd to copy file to printer:  eg: network root - P: copy text.txt to \\ip\
3. On second line overwrite txt file with new values.
Please help, no clue (beginner)
C#
 
private void btnReprint_Click(object sender, EventArgs e)
{
oID.Rewind();
if (oID.DefaultView.Count > 0)
{
do
{
Overwirie existing file with new text
1. Create txt
2. Excute dos cammand
 
}
} while (oID.MoveNext());
}

}

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Please help, help me take step by step.
    1st create txt file
    2nd execute cmd in dos
    :(
    0