Jump to content
AIDA64 Discussion Forum
Novius

Generating reports from script

Recommended Posts

Hello, 

I'm trying to make a batch file that will run AIDA64 (Buisness) and use the custom template ive created. 
I furthermore want the report to be placed in a folder thats name after the Serial Number on the motherboard. (The file must also be named after the Serial Number.) 

Sofar ive come up with:

for /F "skip=2 tokens=2 delims=," %%A in ('wmic bios get serialnumber /FORMAT:csv') do (set "serial=%%A")

echo %serial%

Start D:\AIDA64\Aida64.exe /CUSTOM C:\Users\Jeppe Helbo\Desktop\AIDA64project\fulrep.rpf /LANGEN /R C:\Users\Jeppe Helbo\Desktop\AIDA64project\Testmaskiner\%serial% /XML

PAUSE 

But im not too great at creating batch files, so the above just runs the entire aida full report, and dont output it anywhere. 

Does anyone have some insight on what im doing wrong.

Share this post


Link to post
Share on other sites

If you have a space character or any other special character in your folder name or file name, you need to put it between quotation marks (" characters).  For example:

Start D:\AIDA64\Aida64.exe /CUSTOM "C:\Users\Jeppe Helbo\Desktop\AIDA64project\fulrep.rpf" /LANGEN /R "C:\Users\Jeppe Helbo\Desktop\AIDA64project\Testmaskiner\%serial%" /XML

Also, in case your Windows user is Jeppe Helbo, I'd also improve on your command-line by replacing the fully qualified personal folder name by its Environment variable, which should result in the same output, but would work independent from the name of the current Windows user.  For example:

Start D:\AIDA64\Aida64.exe /CUSTOM "%USERPROFILE%\Desktop\AIDA64project\fulrep.rpf" /LANGEN /R "%USERPROFILE%\Desktop\AIDA64project\Testmaskiner\%serial%" /XML

Check if it works better that way ;)

Also, be aware of using a string from DMI, such as motherboard serial number.  It may contain such characters that cannot be included in a filename.  In such cases AIDA64 will not be able to save the file.

Share this post


Link to post
Share on other sites

Yup that works perfectly!

So i need to add another layer to where the file is stored. 

All the machines im running this on, already have a folder created with their serial number. 

So how do i make the script post the file that i create (Still named as serial when its saved), into the folder thats named serial. 

 

Share this post


Link to post
Share on other sites
43 minutes ago, Novius said:

Yup that works perfectly!

So i need to add another layer to where the file is stored. 

All the machines im running this on, already have a folder created with their serial number. 

So how do i make the script post the file that i create (Still named as serial when its saved), into the folder thats named serial. 

 

If you set the Environment variable serial to the right value, you can use it in your command-line as you've proposed (%serial%).

Share this post


Link to post
Share on other sites
6 minutes ago, Novius said:

So when i run the script from my server, it says: Invalid switch - "/Custom"

Who says that? AIDA64? 

Share this post


Link to post
Share on other sites

My batch file. 

This is printed from CMD when the script runs. 

"\\Directory\Directory\Directory\Directory\AIDA64-JH\AIDA64\Aida64.exe" /CUSTOM \\nas\test\Script\Development\AIDA64-JH\fulrep.rpf /LANGEN /R "\\Directory\Directory\Directory\R90KLBTM\R90KLBTM /XML
Invalid switch - "/CUSTOM".

 

Share this post


Link to post
Share on other sites

To me it seems there's a missing quotation mark (" character) there, before /XML.  A fixed command-line would look like this:

"\\Directory\Directory\Directory\Directory\AIDA64-JH\AIDA64\Aida64.exe" /CUSTOM \\nas\test\Script\Development\AIDA64-JH\fulrep.rpf /LANGEN /R "\\Directory\Directory\Directory\R90KLBTM\R90KLBTM" /XML

Share this post


Link to post
Share on other sites
Start "\\nas\test\Script\Development\AIDA64-JH\AIDA64\Aida64.exe" /CUSTOM \\nas\test\Script\Development\AIDA64-JH\fulrep.rpf /LANGEN /R "\\Directory\specs\Logs_PCd_Burn\%serial%\%serial%" /XML

I tried that, it still gives me the same error. 

Share this post


Link to post
Share on other sites
15 minutes ago, Novius said:

Start "\\nas\test\Script\Development\AIDA64-JH\AIDA64\Aida64.exe" /CUSTOM \\nas\test\Script\Development\AIDA64-JH\fulrep.rpf /LANGEN /R "\\Directory\specs\Logs_PCd_Burn\%serial%\%serial%" /XML

I tried that, it still gives me the same error. 

I guess START.EXE interprets the line incorrectly, so you may need to get rid of the quotation mark characters inside the AIDA64 command-line, and close the whole thing into a single pair of quotation marks, like this:

Start "\\nas\test\Script\Development\AIDA64-JH\AIDA64\Aida64.exe /CUSTOM \\nas\test\Script\Development\AIDA64-JH\fulrep.rpf /LANGEN /R \\Directory\specs\Logs_PCd_Burn\%serial%\%serial% /XML"

Of course if you do this, make sure to not have any space characters anywhere in the AIDA64 command-line.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×