Hi all,
I had written one code for opening Exe file after copying the file folder specifyby me.
This code is worked on Window Xp but it gives error on Windows98 as error 5
Help me.Code is given below:
[code=vb]Private Sub cmdOK_Click()
On Error GoTo errorhand
Dim k As Integer
Dim FS As Object
Dim strBatfile As String
Dim ExecutwDOSComma nd As ApplicationStar tConstants
Set FS = CreateObject("S cripting.FileSy stemObject")
k = FS.CopyFolder(" T:\HEMANT1\LABE L FORMAT", "C:\TESTING\LAB EL FORMAT")
If k = 0 Then
MsgBox "Programs copied on Local Drive", vbExclamation
strBatfile = "c:\Apg\Run.exe "
ExecutwDOSComma nd = Shell("""" & strBatfile & "")
Unload Me
End
End If
errorhand:
If Err.Number = 76 Then
MsgBox "Path is not correct get the programs from local machine", vbCritical
strBatfile = "c:\Apg\Run.exe "
ExecutwDOSComma nd = Shell("""" & strBatfile & "")
Unload Me
End
End If
End Sub[/code]
I had written one code for opening Exe file after copying the file folder specifyby me.
This code is worked on Window Xp but it gives error on Windows98 as error 5
Help me.Code is given below:
[code=vb]Private Sub cmdOK_Click()
On Error GoTo errorhand
Dim k As Integer
Dim FS As Object
Dim strBatfile As String
Dim ExecutwDOSComma nd As ApplicationStar tConstants
Set FS = CreateObject("S cripting.FileSy stemObject")
k = FS.CopyFolder(" T:\HEMANT1\LABE L FORMAT", "C:\TESTING\LAB EL FORMAT")
If k = 0 Then
MsgBox "Programs copied on Local Drive", vbExclamation
strBatfile = "c:\Apg\Run.exe "
ExecutwDOSComma nd = Shell("""" & strBatfile & "")
Unload Me
End
End If
errorhand:
If Err.Number = 76 Then
MsgBox "Path is not correct get the programs from local machine", vbCritical
strBatfile = "c:\Apg\Run.exe "
ExecutwDOSComma nd = Shell("""" & strBatfile & "")
Unload Me
End
End If
End Sub[/code]