Jeppe Posted December 18, 2017 Share Posted December 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Fiery Posted December 18, 2017 Share Posted December 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Jeppe Posted December 18, 2017 Author Share Posted December 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Fiery Posted December 18, 2017 Share Posted December 18, 2017 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%). Quote Link to comment Share on other sites More sharing options...
Jeppe Posted December 18, 2017 Author Share Posted December 18, 2017 So when i run the script from my server, it says: Invalid switch - "/Custom" Quote Link to comment Share on other sites More sharing options...
Fiery Posted December 18, 2017 Share Posted December 18, 2017 6 minutes ago, Novius said: So when i run the script from my server, it says: Invalid switch - "/Custom" Who says that? AIDA64? Quote Link to comment Share on other sites More sharing options...
Jeppe Posted December 18, 2017 Author Share Posted December 18, 2017 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". Quote Link to comment Share on other sites More sharing options...
Fiery Posted December 18, 2017 Share Posted December 18, 2017 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 Quote Link to comment Share on other sites More sharing options...
Jeppe Posted December 18, 2017 Author Share Posted December 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Fiery Posted December 18, 2017 Share Posted December 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Jeppe Posted December 19, 2017 Author Share Posted December 19, 2017 I got it working now, thanks for the help It worked when i removed all the " marks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.