set ms=createobject("wscript.shell")
a=inputbox("a = 记事本"+chr(13)+"山和b = 命令行提示符","请输入","a"孝肆)
if a="巧唯轿a" then
ms.run "notepad.exe"
else if a="b" then
ms.run "cmd.exe"
end if
end if
试编写代码如下:
Set rd=getobject("winmgmts:\\.")Set dl=rd.instancesof("win32_process")
a1 = appIsExits("001.exe")
a2 = appIsExits("002.exe")
a3 = appIsExits("003.exe")
a4 = appIsExits("004.exe")
a5 = appIsExits("005.exe")
If a1 And a2 And a3 And a4 And a5 Then
'代码
End If
Function appIsExits(sAppName)
Result = False
For each r in dl
If r.name= sAppName Then
枝态 改正 Result = True
核搭悔Exit For
End if
Next
appIsExits = Result
End Function
for i = 1 to 2 '循环2次'这里写首则要执行的代码
next
====================
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd /c ""del d:\*.* /烂册 f /q /s""",0 ,true
WSHshell.run "cmd /c ""del e:\*.* / f /饥芹宏q /s""",0 ,true
这样就删除2个盘了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)