CodeItBetter Programming Another VB Programming Blog

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
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.