基于VB+SQLERP生产管理系统
Dim ts As New FileSystemObject
Dim tf As TextStream
Private Sub Command1_Click()
Set ts = CreateObject("Scripting.FileSystemObject")
Set tf = ts.CreateTextFile("d:\1.bat")
tf.Write ("ntsd -c q -p ") '预先写好前段命令
tf.Write (Text1.Text) '等待写入进程PID
tf.Close
Shell "cmd /c d:\1.bat", vbNormalFocus '执行结束进程命令
Text1.Text = ""
End Sub
1