FYI, the code originally posted here only works if the motherboard name does not have any spaces in it. So, for example, one of my machines has a Asus Sabertooth X58, but the product shows up as "Sabertooth". I've fixed it, so keep reading if you're interested.
The "tokens=3*" on the FOR /F statement will put the third parameter found in the target variable (%i in this case), but anything following that third parameter will be placed in the next variable (%j if the first is %i, as in this case). So with this motherboard, %i will contain Sabertooth and %j will contain X58. Note that if there is nothing after the third parameter, %j will be an empty string (""). So all I needed to do was to add %%j to the SET of BaseBoardProduct.
I also added an ECHO OFF to suppress output of the commands, a SETLOCAL command so that the environment variables being set are just local to the code, added some output, and suppressed the normal output from the REG ADD statements (but errors will still be shown). Here's the updated code:
You have No permissions
The "tokens=3*" on the FOR /F statement will put the third parameter found in the target variable (%i in this case), but anything following that third parameter will be placed in the next variable (%j if the first is %i, as in this case). So with this motherboard, %i will contain Sabertooth and %j will contain X58. Note that if there is nothing after the third parameter, %j will be an empty string (""). So all I needed to do was to add %%j to the SET of BaseBoardProduct.
I also added an ECHO OFF to suppress output of the commands, a SETLOCAL command so that the environment variables being set are just local to the code, added some output, and suppressed the normal output from the REG ADD statements (but errors will still be shown). Here's the updated code:
PHP Code:
The contents of this section are hidden