方法一(DOS命令):
先写到一个空的文件当中
然后 type tmpfile >>c:\autoexec.bat方法二:
Private Sub Command2_Click()
Dim intHandle As Integer
Dim newData As String
intHandle = FreeFile
Open "c:\temp\TESTFILE" For Binary As #intHandle
newData = vbCrLf _
& "echo hello" & vbCrLf _
& "dir"
Put #intHandle, LOF(intHandle), newData
Close #intHandle
End Sub
先写到一个空的文件当中
然后 type tmpfile >>c:\autoexec.bat方法二:
Private Sub Command2_Click()
Dim intHandle As Integer
Dim newData As String
intHandle = FreeFile
Open "c:\temp\TESTFILE" For Binary As #intHandle
newData = vbCrLf _
& "echo hello" & vbCrLf _
& "dir"
Put #intHandle, LOF(intHandle), newData
Close #intHandle
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货