用 文件的 .open 方法就可以

解决方案 »

  1.   

    ' 以随机访问方式打开文件。
    Open "D:\bbb.bat" For Random As #1   Put #1, , "AAAAAAAAA"   ' 将记录写入文件中。Close #1   ' 关闭文件。shell
      

  2.   

    open a.bat for input as #1print #1,"calc.exe"close #1
    调用:当EXE调用了
    shell("a.bat")
      

  3.   

    strBat = "del test.exe" & vbCrLf & "ren test1.exe test.exe" & vbCrLf & "del test1.exe"    Open App.Path & "\runbat.bat" For Output As #1
        Print #1, strBat
        Close #1
      

  4.   

    strBat = "del test.exe" & vbCrLf & "ren test1.exe test.exe" & vbCrLf & "del test1.exe"    Open "c:\runbat.bat" For Output As #1
        Print #1, strBat
        Close #1
       shell  "c:\runbat.bat"