I have a .EXE file that i would like to run in visual basic.I did try to use shell script but it does not give me the result i am expecting to get. I need to double click for the exe file to be executed and i do not really know if i can do this inside the visula basic code.
Private Sub Command1_Click()
Dim p1 As Integer
Dim L As Integer
Dim I As String
Dim FileString As String
FileCopy "J:\IO\qebsfnam\pass2ebs", "C:\pass2ebs.txt"
If Dir("C:\pass2ebs.txt") <> "" Then
Open "C:\pass2ebs.txt" For Input As #1
Else
Message = "File not found"
End If
Exit Sub
Rem Open "C:\pass2ebs.txt" For Input As #1
Open "C:\pass.txt" For Output As #2
Do While Not EOF(1)
Line Input #1, FileString
L = Len(FileString)
p1 = InStr(FileString, "/")
I = LTrim(Left(FileString, 6))
If (I = "ITEM01" And p1) Then
If Mid(FileString, p1 - 4, 1) <> "." Then
FileString = Left(FileString, p1 - 4) & "." & Right(FileString, L - p1 + 4)
Print #2, FileString
Else: Print #2, FileString
End If
Else: Print #2, FileString
End If
Loop
Close #1
Close #2
Kill "C:\pass2ebs.txt"
Name "C:\pass.txt" As "C:\pass2ebs.txt"
End Sub
Private Sub Command2_Click()
Shell ("c:\gen.exe")
End Sub
Private Sub Command1_Click()
Dim p1 As Integer
Dim L As Integer
Dim I As String
Dim FileString As String
FileCopy "J:\IO\qebsfnam\pass2ebs", "C:\pass2ebs.txt"
If Dir("C:\pass2ebs.txt") <> "" Then
Open "C:\pass2ebs.txt" For Input As #1
Else
Message = "File not found"
End If
Exit Sub
Rem Open "C:\pass2ebs.txt" For Input As #1
Open "C:\pass.txt" For Output As #2
Do While Not EOF(1)
Line Input #1, FileString
L = Len(FileString)
p1 = InStr(FileString, "/")
I = LTrim(Left(FileString, 6))
If (I = "ITEM01" And p1) Then
If Mid(FileString, p1 - 4, 1) <> "." Then
FileString = Left(FileString, p1 - 4) & "." & Right(FileString, L - p1 + 4)
Print #2, FileString
Else: Print #2, FileString
End If
Else: Print #2, FileString
End If
Loop
Close #1
Close #2
Kill "C:\pass2ebs.txt"
Name "C:\pass.txt" As "C:\pass2ebs.txt"
End Sub
Private Sub Command2_Click()
Shell ("c:\gen.exe")
End Sub