OK, The app. is loaded on an XP network, with a shared USB OkiData dot matrix printer as the default printer on all PC's.
My app. simply monitors a certain folder, when a file is saved to that folder the app prints the file (via a third party application) and moves the file to another folder. Below is the code. On each PC there are two applications that are running.

There is a PointOfSale application - This is the app that writes files to the watched folder, this application is run in a Cmd window.

And the Print App - Below is the code

vb Code:
  1. Option Explicit
  2.     Dim DelFiles(0 To 100) As String
  3.     Dim FS As New FileSystemObject
  4.     Dim FSfolder As Folder
  5.     Dim File As File
  6.     Dim Cmd As String
  7.     Dim ErrCnt As Integer
  8.     Dim ErrCnt1 As Integer
  9.     Dim strStartPath As String
  10.     Dim ClkInt As Long
  11.     Dim LstTen(0 To 9) As String
  12.    
  13. Private Sub CmdRprint_Click()
  14.     Dim TNum As String
  15.     Dim dFil As String
  16.     Dim Highest As Currency
  17.     Dim sFileName As String
  18.     TNum = InputBox("Enter the six digit Invoice Number:", _
  19.                         "Re-Print Ticket")
  20.     dFil = "c:\invprnt\" & TNum & ".txt"
  21.     TNum = "c:\bkupinv\" & TNum & ".txt"
  22.     If MRpt.CheckFileExist(TNum) = True Then
  23.         Call FileCopy(TNum, dFil)
  24.         Kill TNum
  25.     ElseIf TNum = "c:\bkupinv\747.txt" Then
  26.         Call Form_Load
  27.     ElseIf TNum = "c:\bkupinv\00.txt" Then
  28.         sFileName = Dir$("c:\bkupinv\" & "*.txt", vbNormal)
  29.         Do Until sFileName = ""
  30.             If Val(sFileName) > Highest Then
  31.                 Highest = Val(sFileName)
  32.             End If
  33.             sFileName = Dir
  34.         Loop
  35.         Debug.Print "highest number file name = " & Highest & ".txt"
  36.         Call FileCopy("c:\bkupinv\" & Highest & ".txt", _
  37.                       "c:\invprnt\" & Highest & ".txt")
  38.     Else
  39.         MsgBox "Invalid invoice number.", vbOKOnly, "Entry error"
  40.     End If
  41. End Sub
  42.  
  43. Private Sub Form_Load()
  44.     Dim I As Integer
  45.     ClkInt = CLng(basRegistry.regQuery_A_Key _
  46.             (HKEY_LOCAL_MACHINE, "SOFTWARE", "PRNTMONITOR"))
  47.     Timer.Interval = ClkInt
  48.     ListFolder.Interval = ClkInt
  49.     ListFolder.Enabled = False
  50.     Timer.Enabled = False
  51.     strStartPath = "C:\invprnt"
  52.     Cmd = "c:\dosprint\dosprinter /raw "
  53.     Set FSfolder = FS.GetFolder(strStartPath)
  54.     For I = 0 To 9
  55.         LstTen(I) = ""
  56.     Next
  57.     ListFolder.Enabled = True
  58. End Sub
  59.  
  60. Private Sub ListFolder_Timer()
  61.     Dim Cnt As Integer
  62.     Dim I As Integer
  63.     On Error GoTo ErrorHandle
  64.     Timer.Enabled = False
  65.     ListFolder.Enabled = False
  66.     Cnt = 0
  67.     ErrCnt1 = 0
  68.         Text1.Text = ""
  69.         For Each File In FSfolder.Files
  70.             DoEvents
  71.                 Text1.Text = Text1.Text & File & vbCrLf
  72.                 Shell (Cmd & File)
  73.                 DelFiles(Cnt) = File
  74.                 Cnt = Cnt + 1
  75.         Next File
  76.     Timer.Enabled = True
  77.     Exit Sub
  78. ErrorHandle:
  79.     ErrCnt = ErrCnt + 1
  80.     If ErrCnt < 2 Then
  81.         ListFolder.Enabled = True
  82.     Else
  83.         Call MsgBox(Error & vbCrLf & "ListFolder")
  84.     End If
  85. End Sub
  86.  
  87. Private Sub Timer_Timer()
  88.     Dim Flag As Boolean
  89.     Dim Cnt As Integer
  90.     On Error GoTo ErrorHandle
  91.     ListFolder.Enabled = False
  92.     Timer.Enabled = False
  93.     ErrCnt = 0
  94.     Flag = True
  95.     Cnt = 0
  96.     Do While Flag = True And Cnt < 101
  97.         If IsNull(DelFiles(Cnt)) = True Or DelFiles(Cnt) = "" Then
  98.             Flag = False
  99.         Else
  100.             Call FileCopy(DelFiles(Cnt), "c:\bkupinv\" & _
  101.                             Right(DelFiles(Cnt), 10))
  102.             Call Kill(DelFiles(Cnt))
  103.             Cnt = Cnt + 1
  104.         End If
  105.     Loop
  106.     Cnt = Cnt - 1
  107.     Do While Cnt >= 0
  108.         DelFiles(Cnt) = ""
  109.         Cnt = Cnt - 1
  110.     Loop
  111.     ListFolder.Enabled = True
  112.     Exit Sub
  113. ErrorHandle:
  114.     ErrCnt1 = ErrCnt1 + 1
  115.     If ErrCnt1 < 2 Then
  116.         Timer.Enabled = True
  117.         ListFolder.Enabled = False
  118.     Else
  119.         Timer.Enabled = False
  120.         ListFolder.Enabled = True
  121.     End If
  122. End Sub

The problem is that sometimes (not all the time) the application does not print the file. It still move it to the other folder, but it is not send to the printer.
Also sporadically, the printer is very slow in printing the file, by slow I mean sometimes it takes 20 - 40 seconds.

Does anyone see anything that I can fix in the above code? I'm out of options on this and will soon have to try and find another solution, so any help is very much appreciated.

Thanks
-RT