中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 01:40
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How to shorten this script
Printable Version  1,182 / 1
Floor1 chen8919043 Posted 2010-09-19 12:59
初级用户 Posts 21 Credits 20
@echo off&setlocal enabledelayedexpansion
for /f %%i in ('date /t') do set a=%%i
for /f %%j in ('time /t') do set b=%%j
wmic process get name,WorkingSetSize,PrivatePageCount | findstr "QQ.exe" > %tmp%\111.txt
for /f "tokens=1,2,3 delims= " %%k in (%tmp%\111.txt) do set c=%%k&set d=%%l&set /A d=!d!/1024&set e=%%m&set /A e=!e!/1024

echo !a!!b! !c! !d!KB !e!KB>>(%date:~0,10%)front内存占用.txt

If I write it in VBS, how should I write it?
Floor2 qinchun36 Posted 2010-09-20 10:59
高级用户 Posts 400 Credits 609
f="("&Date&")front内存占用.txt" : g=String(11," ") : t=""
Set wmi=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set ps=wmi.ExecQuery("Select * from Win32_Process Where Name='QQ.exe'")
For Each p In ps
t=t&Now&g&p.Name&g&p.PrivatePageCount/1024&"KB"&g&p.WorkingSetSize/1024&"KB"&vbCrLf
Next
CreateObject("Scripting.FileSystemObject").OpenTextFile(f,8,True).Write t
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023