引用:http://www.ooppoo.com/html/60/n-25960.html
想通过VB的Form界面输入变量
然后生成一个批处理文件
可以让比处理文件接受变量
再执行批处理,
这是我现在想实现的一个过程,
不知道能否完成,
望高人指点!
----------------------------------------------------------------------
没有问题啊 写完了保存成“.bat”文件就可以了啊!
--------------------------------------------------------
这是执行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 /参数"
--------------------------------------------------------
Option Explicit
Dim pcl(4) As String
Dim i As Integer
Dim n As Integer
Private 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