How to Add a command to Autoexec.bat
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 'System & API - How to Add a command to Autoexec.bat 'Open the file Autoexec.bat for Append and write the new command. Private Sub cmdAdd_Click() Dim fnum As Integer Dim strTxt As String ' Open the file for append. fnum = FreeFile Open "C:\autoexec.bat" For Append As fnum ' Add the command. strTxt = txtCommand.Text Print #fnum, strTxt ' Close the file. Close fnum MsgBox "Done." End Sub |