One thing to keep in mind is that syntax like %systemroot% is a special function of the Windows command prompt. It parses your input, starting and ending with the % token and determines that should be pulled from a special/environment variable.
When you use waithidden in BigFix, under the hood it’s using a CreateProcess API call in Windows. This does not use the command prompt and so you cannot directly use environment variables in a waithidden statement.
Thanks for the reply, sorry for the late update but when i use the script given by you, it still showing an exit code (-2137219813). and later on my colleague tried this waithidden {(values “UninstallString” of it) of keys whose (value “DisplayName” of it as string contains “Microsoft OneDrive”) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of native registry}) and it works, now i have another scenario where endpoints have different versions of OneDrive. Should i remove the Displayversion from the script?
The version your colleague gave you is the version I’d use too. You asked if you should remove displayversion but I don’t see it in any content here, can you provide your script again?
Generally for uninstall fixlets id only check version if there is a different uninstall process for older versions
waithidden {(values “UninstallString” of it) of keys whose (value “DisplayVersion” of it as string contains “23.054.0313.0001” and value “DisplayName” of it as string contains “Microsoft OneDrive”) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of native registry})