Set User Variables

I am trying to set below user variables as part of an application upgrade but Bigfix is not able to execute the Batch file which is performing the task.

Below is the Batch File:

set TC_ROOT C:\Siemens\Teamcenter10
set TC_DATA \Pl-ts-tc-fsc02\c$\Siemens\teamcenterdata
call \Pl-ts-tc-fsc02\c$\Siemens\teamcenterdata\tc_profilevars.bat
call C:\Siemens\Teamcenter10\install\tem.bat -p ā€œC:\Siemens\wntx64ā€ -dbupdate
@ECHO OFF
ECHO Code executed succesfully

Even after the status for the action is marked completed, I do not see the variables set in the environment variables or the Batch file being called.

Any suggestions on where Iā€™m goofing up ?

By default the actions run under the System Account of OS.
So the action is completed and the variables are set, but they are set for that user.

You can use the override command to execute your task as the current user logged on the system:

override wait
hidden=true
wait yourbatch.bat

Thanks for your reply - would it be possible to set the variables for a single account ?

The Batch file executes and checks for a user account defined in a Config.XML file and the upgrade only works if the batch file is run by the user defined in that XML file.

Thanks

Yes. If the user is logged on the machine(Previously to run the task), the fixlet will run with that user, otherwise the action will fail.

1 Like

Hey - is it possible to Run as Current Logged on User with admin privileges ?

Yes, If UAC is off it will be able to run command as administrator.

Sadly UAC is not turned off. I was trying to find a way where I could run the task with a Service Account that has local admin access and open up command prompt with elevated privileges.

Something like PsExec, but so far I have had no luck with it.