Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Run Registry file that WILL be created

Hello Community,

I have to add the value %username% (logged on user) in the registry, in the "HKEY_LOCAL_MACHINE" which needs the administrative rights. So, if my %username% doesn't have administrative rights (which will always be the case) it fails.

To avoid this, I created a "Command" step "Run As Logged on User" with the following commands:

echo Windows Registry Editor Version 5.00 >> c:\temp\forticlient-set-username.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Fortinet\FortiClient\Sslvpn\Tunnels\VPN Solisco] >> c:\temp\forticlient-set-username.reg
echo "DATA1"="%username%" >> c:\temp\forticlient-set-username.reg

So I have the good %USERNAME% in the registry file.

Next step runs the registry file %temp%\forticlient-set-username.reg "Run as Deploy User" so it can write in the HKEY_LOCAL_MACHINE

My issue is that the install step which runs the registry file give a warning because the reg file doesn't exists (will be created in the step before) and as it give a warning I can't deploy it (the "Deploy Now" button is greyed).

My workaround is to create a batch file in my (pdqRepository) and in this file execute the forticlient-set-username.reg

Do you see any different ways to achieve this? Simplify it? Do I miss something?

Thank you

0

Comments

0 comments