I’m having an issue with the action script below, I’m trying to output the SIM ICCID to the registry. According to Bigfix the action completes successfully but the registry key is not created.
If I replace the command with the mkdir in comment, the folder is created.
If I run the created bat file manually on the client under the system account, the registry key is created.
createfile until end @ECHO OFF
for /f “tokens=5” %%G in (‘netsh mbn show ready * ^| find “SIM ICC Id”’) do reg add HKLM\Software\YPTO /v “SIM ICC” /t REG_SZ /d %%G /f
// mkdir c:\temp\test
set BESExitCode=%errorlevel%
exit %BESExitCode% end
move createfile run{id of active action}.bat
wait run{id of active action}.bat
// Get the return code of the previous action.
parameter “returnCode” = “{exit code of action}”
// Clean up the intermediary .bat file
// delete run_{id of active action}.bat
// Task will now exit.
exit {parameter “returnCode”}
If so the client is a 32 bit application and thus the path you state is redirected to HKEY_LOCAL_MACHINE\Software\Wow6432Node\YPTO so is that where you wanted it?
Also remember that HKLM is a shortcut only for BigFix relevance so you will need to spell out HKEY_LOCAL_MACHINE when calling the OS commands
If you mean to go to the true 64 bit location of HKEY_LOCAL_MACHINE\Software\YPTO then you can either use the regadd64 actionscript but as you are doing a loop you might not be able to so you would need to turn off the redirection (borrowed this fun variant from http://bigfix.me
// Disable wow64 redirection on x64 OSes
action uses wow64 redirection {not x64 of operating system}
Note that doing that the redirection of the location that the client is running in is also removed so you may have to test this.
I think that’s a formatting problem caused by not using the ‘preformatted text’ tag or the three-backticks for markup.
Because you had text surrounded by underscores, the forum took that to be formatting marking and displays the text in italics instead of displaying the underscores.
An even better way is to put three backticks (the one to the left of the “1” key) above and below your actionscript.
```
action script here
```
That applies Relevance formatting to the posting, so it displays like this:
createfile until end
@ECHO OFF
for /f "tokens=5" %%G in ('netsh mbn show ready * ^| find "SIM ICC Id"') do reg add HKLM\Software\YPTO /v "SIM ICC" /t REG_SZ /d %%G /f
// mkdir c:\temp\test
set BESExitCode=%errorlevel%
exit %BESExitCode%
end