I built, compiled, and ran the application error-free on my Win2k PC. When I load the application on a WinXP PC I error out 'File not Found'. I can not find any reason for the error. below is the code the form consist of a text box "text1" and two timers.
vb Code:
Option Explicit Dim DelFiles(0 To 100) As String Dim FS As New FileSystemObject Dim FSfolder As Folder Dim File As File Private Sub Form_Load() Dim strStartPath As String strStartPath = "C:\invprnt" Call ListFolder(strStartPath) End Sub Private Sub ListFolder(sFolderPath As String) Dim i As Integer Dim Cnt As Integer Dim Cmd As String Cmd = "c:\dosprint\dosprinter /raw " Cnt = 0 StrtTime.Enabled = False Set FSfolder = FS.GetFolder(sFolderPath) Text1.Text = "" For Each File In FSfolder.Files DoEvents Text1.Text = Text1.Text & File & vbCrLf Shell (Cmd & File) DelFiles(Cnt) = File Cnt = Cnt + 1 Next File Timer.Enabled = True End Sub Private Sub StrtTime_Timer() StrtTime.Enabled = False Call ListFolder("c:\invprnt") End Sub Private Sub Timer_Timer() Dim Flag As Boolean Dim Cnt As Integer Timer.Enabled = False Flag = True Cnt = 0 Do While Flag = True And Cnt < 101 If IsNull(DelFiles(Cnt)) = True Or DelFiles(Cnt) = "" Then Flag = False Else Call FileCopy(DelFiles(Cnt), "c:\bkupinv\" & Right(DelFiles(Cnt), 11)) Cnt = Cnt + 1 End If Loop Flag = True Cnt = 0 Do While Flag = True And Cnt < 101 If IsNull(DelFiles(Cnt)) = True Or DelFiles(Cnt) = "" Then Flag = False Else Call Kill(DelFiles(Cnt)) Cnt = Cnt + 1 End If Loop Cnt = Cnt - 1 Do While Cnt >= 0 DelFiles(Cnt) = "" Cnt = Cnt - 1 Loop StrtTime.Enabled = True End Sub
Thanks for any suggestions
-RT




Reply With Quote