2008-09-18 7 views
1

commit charge를 찾고 있습니다. 당신이 CScript를 아래에서이 스크립트를 실행하면수수료를 프로그래밍 방식으로 찾는 방법?

strComputer = "." 

Set objSWbemServices = GetObject("winmgmts:\\" & strComputer) 
Set colSWbemObjectSet = _ 
objSWbemServices.InstancesOf("Win32_LogicalMemoryConfiguration") 

For Each objSWbemObject In colSWbemObjectSet 
Wscript.Echo "Total Physical Memory (kb): " & _ 
objSWbemObject.TotalPhysicalMemory 
WScript.Echo "Total Virtual Memory (kb): " & _ 
objSWbemObject.TotalVirtualMemory 
WScript.Echo "Total Page File Space (kb): " & _ 
objSWbemObject.TotalPageFileSpace 
Next 

, 당신은 명령 창에 표시되는 대상 컴퓨터에 설치된 실제 메모리의 KB 수를 볼 수 :

+0

과 같이 요금을 커밋 다음은 스크립트의 전형적인 출력 in http://en.wikipedia.org/wiki/Commit_charge – Chris

답변

4
public static long GetCommitCharge() 
    { 
     var p = new System.Diagnostics.PerformanceCounter("Memory", "Committed Bytes"); 
     return p.RawValue; 
    } 
1

여기 WMI를 사용하는 예제입니다. 총 실제 메모리 (KB) : 261676이

편집 :에서 촬영도 포함 총 페이지 파일 크기 속성

: http://www.microsoft.com/technet/scriptcenter/guide/sas_wmi_dieu.mspx?mfr=true

+0

나는 이것이 Commit Charge의 가치라고 생각하지 않는다. 총 물리적/가상 메모리가 설치되었음을 보여줍니다. – Larsenal

+0

총 페이지 파일 크기도 포함하도록 편집 됨 - 미안한데 – JustinD

관련 문제