All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
i want to make a check that checks the output of the dos-box command.
i want to check , and HM reply , the last line from the defrag command.
Here is the example from the dos-box :
C:\Users\Administrator>defrag c: /a
Microsoft Drive Optimizer
Copyright (c) 2013 Microsoft Corp.
Invoking analysis on (C:)...
The operation completed successfully.
Post Defragmentation Report:
Volume Information:
Volume size = 49,99 GB
Free space = 37,35 GB
Total fragmented space = 30%
Largest free space size = 30,66 GB
Note: File fragments larger than 64MB are not included in the fragmentation statistics.
It is recommended that you defragment this volume.
is it possible to get this line in the Reply field of HM ? It is recommended that you defragment this volume.
or better Total fragmented space = 30%
and then in this case 30%
I allready played with some scripts but i did not find the solution.
Can you please help me ?
Many many thanks in advance
M
Last edited by menno on Thu Jan 28, 2016 5:34 am, edited 2 times in total.
You could make a VBS script which captures the output of the text, loops through it and processes it.
The below (bit messy sorry) example is an example of looking through the output of Ipconfig and sets a variable to 1 if it finds "192.168." within the output.
set WSHShell = WScript.CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("cmd /c ipconfig")
Do until oExec.Stdout.atEndOfStream
oReadLine = oExec.StdOut.ReadLine
If instr(oReadLine, "192.168.") > 0 Then
oNetExtenderFound = 1
End If
Loop
wscript.echo oNetExtenderFound
Script requires 0, 1 or 2 parameters: [disk letter [max defreg threshold]]
Several examples:
<no parameters specified> - script will check fragmentation of c drive
d - script will sheck fragmentation % of drive d
c 11 - script will check drive c for fragmentation percent and set Bad status if fregmented space is more than 11 % (script will ignore defrag recommendation)