Error message 60002

Hi to all,

I need to uninstall an exe file before the main installation.

When I am running the command:
Execute-Process -path "C:\Guideline\unins000.exe" -parameters '/VERYSILENT'
I am getting an error message:
Message : Function failed, setting exit code to [60002]. File [C:\Guideline\unins000.exe] not found.

Seems that the file is not always present in all workstations.
Is there is a way to add a parameter to that command to continue the script even though the file is not present?

Thanks
Amir

hi, try this:

if (test-path ‘C:\Guideline\unins000.exe’)
{
Execute-Process -Path ‘C:\Guideline\unins000.exe’ -Parameters ‘/VERYSILENT’ -wait -WindowStyle ‘Hidden’
}

1 Like

If you don’t want to verify if the file exists before you run it as GorgoMoondust suggested you can use one of the following parameters to the Execute-Process function:
-ContinueOnError $true
-IgnoreExitCodes ‘60002’

Documentation of the function:
Execute-Process · PSAppDeployToolkit

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.