If calling the .exe works fine, but calling the script does not I would recommend adding some logging to the script to try and determine where the failure with the script is happening. As long as both the .exe and script are copied as part of the Custom Action then calling either of them should work. Regarding your questions:
- Can a 'custom_script' run when changing directory outside of 'C:\Windows\ProPatches\Installation\%PATHTOFIXES%'? Meaning use CD C:\Temp as an example.
Yes, a script can be called from any directory on the endpoint, for example you coulda use "call C:\Temp\Custom_script.bat" to call a .bat file located in C:\Temp. Remember that the script would have to have been placed there by some other method as pushed items from the Custom Actions will only be copied to %PATHTOFIXES%.
- Can you call a .exe within a sub-directory of %PATHTOFIXES%? For example 'call %PATHTOFIXES%\Folder\application.exe'
Theoretically you could call an .exe within a sub-directory of %PATHTOFIXES%, but as that variable is the temporary directory created as part of the deployment there won't be any sub-directories there unless something else creates them during the deployment.
Is there a way to launch the script with elevated rights with Ivanti? I've tried launching some simple test scripts and seems to work. But, scrips that needs elevated rights seems to not work.
Scripts, along with the rest of the deployment, is run as the local system account which typically is elevated enough for most purposes. If you are seeing failures with certain scripts, you can use the following instructions to help you test if the system account has problems with the action: How To Test SYSTEM Account Permissions
As for launching the script with elevated rights, there is not a way in Patch for Windows to change how the script is launched. You could use other methods to execute actions as a different account, but that would be done outside of PWS.