Jump to content
Sign in to follow this  
PsychOfMSE

Issue passing Variable into Command Line Switch

Recommended Posts

PsychOfMSE

Here's my script:

FileInstall("C:\AutoItCitrix\CitrixOnlinePluginFull.exe",@TempDir)
FileInstall("C:\AutoItCitrix\CitrixUpdate.bat",@TempDir)
FileChangeDir(@TempDir)
RunWait("CitrixUpdate.bat")

If @OSArch = "X86" Then
$regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine'
$regKey = 'ClientName'
$regPath_x86 = RegRead($regAddress,$regKey)
FileChangeDir(@TempDir)
RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" ENABLE_DYNAMIC_CLIENT_NAME="No" CLIENT_NAME='$regPath_x86' SERVER_LOCATION="Http://xenapp"')

    
 Else
$regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine'
$regKey = 'ClientName'
$regPath_x64 = RegRead($regAddress,$regKey)
FileChangeDir(@TempDir)
RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" ENABLE_DYNAMIC_CLIENT_NAME="No" CLIENT_NAME='$regPath_x64' SERVER_LOCATION="Http://xenapp"')

Basically what I need to do is pull the "ClientName" value from the registry and insert it into the "Client_Name" command line switch in the "RunWait" line.

What am I doing wrong?  How would I go about inserting the readout of the Reg Value into the command line switch?

Thanks so much guys!  (I'm a noobie BTW!, please go easy on me.  I've been doing nothing but searching and using the help file all day).  This is my first script.

Share this post


Link to post
Share on other sites
michaelslamet

Hi Psych,

Untested, try this:

RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" ENABLE_DYNAMIC_CLIENT_NAME="No" CLIENT_NAME="' & $regPath_x86 & '" SERVER_LOCATION="Http://xenapp"')

 

Same format for "Else" part

Share this post


Link to post
Share on other sites
PsychOfMSE

Ah, now I see a new problem.

The "CitrixUpdate.bat" file uninstalls any previous citrix installation which also removes the reg value I am trying to call in the install.

Is there any way I can get around this?

I guess I need to write the $regpath variable to be able to be called later?

Share this post


Link to post
Share on other sites
michaelslamet

Yes, save/store it in a variable before the CitrixUpdate.bat run :)

Share this post


Link to post
Share on other sites
PsychOfMSE

I assume that would be done like:

$RegValue_x86 = Eval($regPath_x86)

And then call the $RegValue_x86 variable?

Share this post


Link to post
Share on other sites
michaelslamet

Simply read the regkey value before you run CitrixUpdate.bat

$regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine'
$regKey = 'ClientName'
$regPath_x86 = RegRead($regAddress,$regKey)

 

If you want to give a variable a value, use like this:

$var_A = $Var_B

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×