DOS TYPE command from within VB

  • Thread starter Thread starter Darin
  • Start date Start date
D

Darin

I need to open a cash drawer and the easiest way to do that is to:

ECHO "||" > LPT1

I have put:

system.diagnostics.process.start (my echo command)

but it fails with a File Not Found error.

Any ideas???

Darin
 
I never had any luck using shell with Echo. The redirect Console app saved
me from insanity. I could not get the echo to work via the shell with gpg
commands.
 
Darin said:
Shell worked fine.

Can you post the working code? 'Shell' does not have any advantage over
'Process' in processing command-line shell commands.
 
junk = "ECHO " & Qte(Chr(1) & Chr(1), True) & " > " & Trim(port)
Shell(junk, AppWinStyle.Hide)

Qte is a routine that will put text in " ", so this is:

ECHO "ctrl-A ctrl-A" > LPT1

Darin
 
you can use Process.StartInfo:

Sub Print()
Dim p As Process = New Process
With p.StartInfo
.FileName = "cmd"
.Arguments = "/c echo ""||"">LPT"
.UseShellExecute = False
.CreateNoWindow = True
End With
p.Start()
End Sub
 
Well, I guess I know what you now mean about shell having issues.

SHELL with the ECHO command worked perfectly on my development XP Pro
machine.
Send the program to the csutoemr and they try it on an XP machine (don't
know if it is pro or home) and he gets an error: File not Found.

I will change it to use the Process.StartInfo and hopefully I won't have
this issue again.

I will let you know.

Darin
 
Back
Top