VB Script question

5 pts.
Tags:
VBScript
VBScript Functions
why doesn't the statement if (thres_PrivateBytes > cur_PrivateBytes) work properly? it was working when I had the WMI data type as Real32 and now it's UINT32 because I didn't have a conversion from scientific notation to decimal. Anyway, do I need to declare the vars as integers? my theory is that either one of the vars is seen by VB as a integer and the other as a string? I didn't see different operators for string vs. integers ( gt vs. > - like there is in Perl). Any help will be greatly appreciated. Process_Name = oArgs(0) Process_Name2 = oArgs(1) thres_PrivateBytes = oArgs(2) Set objWMIService = GetObject("winmgmts:" & strComputer & "rootCIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM TMW_Process", "WQL" , _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems if (objitem.Process = Process_Name) then cur_PrivateBytes = objItem.PrivateBytes if (thres_PrivateBytes > cur_PrivateBytes) then if (Logging = 1) then WriteLog ("Private Bytes Threshold was exceeded " & thres_PrivateBytes & " > " & "current PrivateBytes: " & cur_PrivateBytes & " Process_Name " & Process_Name) End if End if End if C:TEMP>cscript memory_leak_2-process.vbs csrss mailman 1500000 1 Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. ========================================== Computer: localhost Script in debug mode - see c:tempmemory_leak.log Process: mailman [8/11/2008 3:37:09 PM] HandleCount: 87 [8/11/2008 3:37:09 PM] ID: 5304 [8/11/2008 3:37:09 PM] PageFaultsSec: 0 [8/11/2008 3:37:09 PM] PageFileBytes: 1343488 [8/11/2008 3:37:09 PM] PercentPrivilegedTime: 0 [8/11/2008 3:37:09 PM] PercentProcessorTime: 0 [8/11/2008 3:37:09 PM] PercentUserTime: 0 [8/11/2008 3:37:09 PM] PoolNonPagedBytes: 3256 [8/11/2008 3:37:09 PM] PoolPagedBytes: 27604 [8/11/2008 3:37:09 PM] PriorityBase: 8 [8/11/2008 3:37:09 PM] PrivateBytes: 1343488 [8/11/2008 3:37:09 PM] VirtualBytes: 2.779546E+07 [8/11/2008 3:37:09 PM] WorkingSet: 3915776 [8/11/2008 3:37:09 PM] ------ End of Process Metrics ------ [8/11/2008 3:37:09 PM] Private Bytes Threshold was exceeded 1500000 > current PrivateBytes: 1343488 Process_Name mailman 8/11/2008 3:37:08 PM] Process: csrss [8/11/2008 3:37:08 PM] HandleCount: 784 [8/11/2008 3:37:08 PM] ID: 340 [8/11/2008 3:37:08 PM] PageFaultsSec: 0 [8/11/2008 3:37:08 PM] PageFileBytes: 2293760 [8/11/2008 3:37:08 PM] PercentPrivilegedTime: 0 [8/11/2008 3:37:08 PM] PercentProcessorTime: 0 [8/11/2008 3:37:08 PM] PercentUserTime: 0 [8/11/2008 3:37:08 PM] PoolNonPagedBytes: 7840 [8/11/2008 3:37:08 PM] PoolPagedBytes: 109460 [8/11/2008 3:37:08 PM] PriorityBase: 13 [8/11/2008 3:37:08 PM] PrivateBytes: 2293760 [8/11/2008 3:37:08 PM] VirtualBytes: 7.770112E+07 [8/11/2008 3:37:08 PM] WorkingSet: 1806336 [8/11/2008 3:37:08 PM] ------ End of Process Metrics ------ [8/11/2008 3:37:08 PM] Private Bytes Threshold was exceeded 1500000 > current PrivateBytes: 2293760 Process_Name csrss

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BrentSheets
    Minnow, you may be interested in one of our community blogs written by a fellow ITKE member Jerry Lees. It's called The VBScript Network and Systems Administrator’s Cafe. Jerry covers all types of VBScript information. Description: Be lazy! Stop beating yourself to death doing redundant tasks. Script it instead! I’ll discuss VBScript, products and technologies that will make your life easier as a Microsoft Windows administrator. This blog covers a variety of topics such as IIS, Exchange, ISA, and other standard Microsoft services.
    6,925 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following