Ever want to open an executable but couldn't because of End Of File. Well this code opens executabl
Ever want to open an executable but couldn't because of End Of File. Well this code opens executable files in binary and saves their machine
Rate Ever want to open an executable but couldn't because of End Of File. Well this code opens executabl
(1(1 Vote))
Dim strPath As String
'Code was created by Jessy Butzke
Private Sub Command1_Click()
Dim fso
Dim b As Byte
Set fso = CreateObject("Scripting.FileSystemObject")
With cmnDlg
.FileName = "*.exe"
.DefaultExt = "exe"
.DialogTitle = "Open Exe Files"
.Filter = "*.exe"
.ShowOpen
End With
If Trim(Me.cmnDlg.FileName$) <> "" Then
If fso.FileExists(Me.cmnDlg.FileName$) Then
Me.Label1.Caption$ = "Working..."
Me.Refresh
MsgBox "This might take a while to load. Please be patient.", vbInformation, "Notice"
Open Me.cmnDlg.FileName For Binary Access Read As #1
Open strPath$ & "Data.txt" For Binary Access Write As #2
Do While Not EOF(1)
Get #1, , b
Put #2, , b
DoEvents
Loop
Close #1
Close #2
Me.Label1.Caption$ = "Done"
Me.Refresh
MsgBox "A file named Data.txt has been generated at: " & strPath$ & ".", vbInformation, "Notice"
Else
MsgBox "The file that you are requesting does not exist.", vbCritical, "Error"
End If
End If
End Sub
Private Sub Form_Load()
If Len(App.Path) > 3 Then
strPath$ = App.Path & "\"
Else
strPath$ = App.Path
End If
End Sub
Ever want to open an executable but couldn't because of End Of File. Well this code opens executabl Comments
No comments yet — be the first to post one!
Post a Comment