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 |
Related posts:
- How to replace a line for particular line number
- Search & Delete the Line for Given Search String in a text file
- How to Export an Access Database to HTML file
- How to Search & Replace the Line for Given Search String in a text file
- How to write text in a given text file (in three ways)
- How to get the command line arguments using the Command() function?
- How to merge two text files
- How to add contents of text file to a list box
- How to I create a text file from part of another text file (for given line numbers like Line No. 2 to 7)
- How to Extract each and every word individually from a text file