![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-12 18:39 |
共 47,811 主题排行 / 349,897 发帖 / 今日 0 篇 / 48,256 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » 求助:帮我看下这个检测进程的脚本 谢谢 |
| 可打印版本 1,113 / 0 |
| 第1楼 dglichong | 发表于 2009-12-02 01:09 |
| 新手上路 发帖 2 积分 3 | |
|
求助:帮我看下这个检测进程的脚本 谢谢 如果进程TInstall.exe存在则执行D:\Soft\desktopli\1130\off.bat,如果进程不存在则执行D:\Soft\desktopli\1130\li.vbs,并且没有检测到Tinstall.exe就一直检测!
option Explicit dim wmi,proc,procs,proname,flag,WshShell Do proname="TInstall.exe" set wmi=getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2") set procs=wmi.execquery("select * from win32_process") flag=true for each proc in procs if strcomp(proc.name,proname)=0 then flag=false exit for end if next set wmi=nothing if not flag then Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "D:\Soft\desktopli\1130\off.bat",0,True Set Wsh=NoThing WScript.quit end if wscript.sleep 1000 loop 另外一个问题:随机读取ID.txt(ID.txt里全是进程名)里的一行将A.exe改名为读取到的进程名,然后执行现在这个程序! randomize set fso=createobject("scripting.filesystemobject") set a=createobject("scripting.dictionary") set file=fso.opentextfile("iD.txt") do while file.atendofstream<>true m=m+1 a.add m,file.readline loop file.close h=int(rnd*m) createobject("scripting.filesystemobject").opentextfile("li.txt",2,-1).write a(h) Dim Wsh Set Wsh = WScript.CreateObject("WScript.Shell") WScript.Sleep(0000) Wsh.Run "on.bat",0,True Set Wsh=NoThing WScript.quit [ Last edited by dglichong on 2009-12-2 at 01:12 ] |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |