Jump to content

Generating reports from script


Jeppe

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.

Link to comment
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.

Link to comment
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. 

 

Link to comment
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%).

Link to comment
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".

 

Link to comment
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
Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...