MrxuanJ / open-hardware-monitor

Automatically exported from code.google.com/p/open-hardware-monitor
0 stars 0 forks source link

Add a command line interface #230

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In certain cases it could be useful to have a command line interface to just 
output a report instead of loading the complete GUI. A minimal standalone 
report command line implementation can be found in the attachment.

Original issue reported on code.google.com by moel.mich on 30 May 2011 at 12:30

Attachments:

GoogleCodeExporter commented 9 years ago
When I try to test using Program.cs, everything loads besides the temperatures. 
In my output, I noticed it says this when it works: 
Ring0

Status: Installing driver "C:\Users\Unknown\AppData\Local\Temp\tmp2D82.tmp" 
failed and file exists

Exception: This driver has been blocked from loading (Exception from HRESULT: 
0x800704FB)

When it works, (When using YOUR compiled exe), it doesn't show that error and 
the temperatures show.

I think the issue is that Ring0 can't run. I tried Right clicking and Running 
as Administrator on my Debug exe, and it gives the same result.

Original comment by Cre...@gmail.com on 10 Jan 2012 at 7:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Change the Project Type to x64 on a 64-bit system and it works! Do you know if 
there's a way to compile a working x86 version on a 64bit system?

Original comment by Cre...@gmail.com on 10 Jan 2012 at 8:05

GoogleCodeExporter commented 9 years ago
There is still an issue in the Open Hardware Monitor library code, which 
prevents it from loading the correct driver in a 32-bit process on x64 systems 
(see Issue 274). The Issue 274 is not hard to fix, its just not been done yet. 
At the moment it is best to compile your application as "Any CPU".

Original comment by moel.mich on 10 Jan 2012 at 8:11

GoogleCodeExporter commented 9 years ago
Any CPU worked! You're the best moel.mich!!

Original comment by Cre...@gmail.com on 10 Jan 2012 at 8:25

GoogleCodeExporter commented 9 years ago
Hi, This is interesting.  Is there a version of this, that is completely 
command line driven, or prints out a report ?    The attached app had a 
problem, but I'm not a developer of .cs so I can't compile it :)

Original comment by sam...@gmail.com on 15 Jul 2012 at 1:44

GoogleCodeExporter commented 9 years ago
Thanx for perfect tool!
Could you compile new OpenHardwareMonitorReport.exe which compatible with 
latest Open Hardware Monitor?

Original comment by asipe...@gmail.com on 31 Jul 2012 at 12:04

GoogleCodeExporter commented 9 years ago
Issue 375 has been merged into this issue.

Original comment by moel.mich on 28 Oct 2012 at 7:29

GoogleCodeExporter commented 9 years ago
I tried to add the command line feature directly to the 
OpenHardwareMonitor.exe. Unfortunately, this seems not to be possible in a 
clean way. When an application is started from the command line, the command 
line seems to determine if it is a command line application or a windowed 
application. If it is a windowed application it is started asynchronously which 
prevents any output from being written back to the console in a controlled 
(synchronous) way.

Anyway I have compiled a new command line report writing application. Source 
and executable are attached.

Original comment by moel.mich on 28 Oct 2012 at 9:17

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you!!!
Could add OpenHardwareMonitorReport.exe into zip archive with 
OpenHardwareMonitor in future?

Original comment by asipe...@gmail.com on 24 Dec 2012 at 8:16

GoogleCodeExporter commented 9 years ago
VB.NET - Source Code by Marco Cusano (Retrieve Name of Hardware)
Sorry for my English, but i'm Italian.

FIRST:
Imports OpenHardwareMonitor
Imports OpenHardwareMonitor.Hardware

SECOND:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'Computer object
    Dim cp As New Computer()
    cp.Open()
    cp.HDDEnabled = True
    cp.RAMEnabled = True
    cp.GPUEnabled = True
    cp.MainboardEnabled = True
    cp.CPUEnabled = True
    'Finds the Hardware index of the Processor
    'This can be a method or can be put in your loading sequence
    'For this example, we'll be using a method
    Dim Info As String = ""
    For i As Integer = 0 To cp.Hardware.Count() - 1
        If cp.Hardware(i).HardwareType = HardwareType.Mainboard Then
            Info += " Scheda Madre: " & Trim(cp.Hardware(i).Name)
        End If
        If cp.Hardware(i).HardwareType = HardwareType.CPU Then
            Info += " Processore: " & Trim(cp.Hardware(i).Name)
        End If
        If cp.Hardware(i).HardwareType = HardwareType.GpuNvidia Then
            Info += " Scheda Video: " & Trim(cp.Hardware(i).Name)
        End If
        If cp.Hardware(i).HardwareType = HardwareType.RAM Then
            Info += " RAM: " & Trim(cp.Hardware(i).Name)
        End If
        If cp.Hardware(i).HardwareType = HardwareType.HDD Then
            Info += " HDD: " & Trim(cp.Hardware(i).Name)
        End If
        If cp.Hardware(i).HardwareType = HardwareType.SuperIO Then
            Info += " SuperIO: " & Trim(cp.Hardware(i).Name)
        End If
    Next
    MessageBox.Show(Trim(Info))
End Sub

Original comment by marco.cu...@gmail.com on 27 Jun 2013 at 6:00