峰 发表于:2018-10-14 13:45:46
这个是打开文件a的同时打开文件b,并且文件a关闭则自动关闭文件b。但是我的.mdb文件却打不开,换成.exe文件或access执行文件就可以。请高手帮忙!
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errResult = objWMIService.Create("D:\单位软件\A证\PCVR30.exe", null, null, intCalcID)
errResult = objWMIService.Create("D:\单位软件\A证\DB\CVR_ID.mdb" , null , null, intNotepadID)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecNotificationQuery _
("Select * From __InstanceDeletionEvent " _
& "Within 1 Where TargetInstance ISA 'Win32_Process'")
Do Until i = 999
Set objProcess = colProcesses.NextEvent
If objProcess.TargetInstance.ProcessID = intCalcID Then
Exit Do
End If
Loop
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where ProcessID = " & intNotepadID)
For Each objProcess in colProcesses
objProcess.Terminate()
Next
等会vbs 的来解答把
总记录:1篇 页次:1/1 9 1 :