没有问题啊 写完了保存成“.bat”文件就可以了啊!

解决方案 »

  1.   

    这是执行dir/w命令的程序:
    strCmd = "dir/w"
    Open "c:\command.bat" for output as #1
    Print #1, strCmd
    Close #1
    Shell "c:\command.bat" '传入参数可以这样:Shell "c:\command.bat /参数"
      

  2.   

    Option Explicit
    Dim pcl(4) As String
    Dim i As Integer
    Dim n As IntegerPrivate Sub Command1_Click()
    n = InputBox("输入批处理命令条数" )
    For i = 1 To n
    pcl(i) = InputBox("输入批处理命令" & i)
    Next
    Open "c:\CopyMl.bat" For Output As #1
    For i = 1 To 2
    Print #1, pcl(i)
    Next
    Close
    Shell ("c:\CopyMl.bat")
    End Sub