The Flexera Community is currently in maintenance mode to prepare for the upcoming launch of the new community. Click here for more information.
Hi - I'm new to using Flexera and I've been tasked with creating a batch/cmd file to run MGSPolicy.exe -t Machine. It runs but I get no message whether it completes successfully. Is there any way on the client machine to know if it ran successfully? I currently do not have access to the server. Looking for any help as I always like to make sure scripts run completely and successfully.
Aug 25, 2022 10:17 AM
One approach would be to check the exit status of the mgspolicy process. For example:
start /wait mgspolicy -t Machine
if %ERRORLEVEL% neq 0 echo Policy updated failed
You could also look at the end of the <TempDirectory>\ManageSoft\policy.log file, which will show an indication of whether the process succeeded or failed. It if succeeded:
[04/21/2022 3:25:37 PM (G, 0)] {784} Program exited successfully
If it failed, a non-0 code will be noted:
[10/22/2022 12:22:32 PM (G, 0)] {11896} Program exited with code 1
Aug 25, 2022 09:43 PM