From 9098cccfc3f5cefd609f87547cfd88a76e57d288 Mon Sep 17 00:00:00 2001 From: mariopulido87 Date: Mon, 9 Dec 2013 15:38:09 +0000 Subject: [PATCH] 2013-12-09 Mario Pulido * bin/util/df_percent.vbs: Bug fixes wrong values. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9195 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/win32/ChangeLog | 4 ++++ pandora_agents/win32/bin/util/df_percent.vbs | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 9806bb6828..7f2f440ffa 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,7 @@ +2013-12-09 Mario Pulido + + * bin/util/df_percent.vbs: Bug fixes wrong values. + 2013-11-14 Ramon Novoa * main.cc: Quote the path to the service binary to avoid exploits. diff --git a/pandora_agents/win32/bin/util/df_percent.vbs b/pandora_agents/win32/bin/util/df_percent.vbs index b904324836..e5b3406860 100644 --- a/pandora_agents/win32/bin/util/df_percent.vbs +++ b/pandora_agents/win32/bin/util/df_percent.vbs @@ -26,13 +26,19 @@ For Each objItem in colItems ' Include only harddrivers (type 3) If (objItem.FreeSpace <> "") AND (objItem.DriveType =3) Then Percent = round ((objItem.FreeSpace / objItem.Size) * 100, 2) - Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine " " Wscript.StdOut.WriteLine " " - Wscript.StdOut.WriteLine " " - Wscript.StdOut.WriteLine "" - Wscript.StdOut.flush + if (Percent > 99.99) then + Wscript.StdOut.WriteLine " " + elseif (Percent < 0.01) then + Wscript.StdOut.WriteLine " " + else + Wscript.StdOut.WriteLine " " + Wscript.StdOut.WriteLine "" + Wscript.StdOut.flush + End If End If + End If Next