by revega (5 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Wed 5th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Create and then execute a DOS batch file from within your program. 4 lines of code, no API, works will all VB versions.
'** Create then execute a batch file
'** Compatible with all Winblows versions of
'** Visual Basic.
'**
'** From: revega May 06, 2002
'------------------------------------------
'
' Put this inside a command button or menu
Open "c:\echo.bat" For Output As #1
Print #1, "echo I was created in Visual Basic." 'Replace with your text
Close #1
'Note: one Print statement per line in the batch file.
'If you need more lines just put another PRINT #1, "blah" under the other one.
'Do this as many times as you need.
x = Shell("c:\echo.bat", 1) 'Now execute the file
No comments have been posted about Create and then execute a DOS batch file from within your program. 4 lines of code, no API, works w. Why not be the first to post a comment about Create and then execute a DOS batch file from within your program. 4 lines of code, no API, works w.