Jump to content

Recommended Posts

Posted

Hello,

I am currently automating and MSI install. Part of the install asks me for the computer's hostname. I know there is an enviromental variable of %COMPUTERNAME%, so if I can pass that along to the installer, that would be good...

I also tried a regead with a variable.... No luck..

Here is the code I tried....

$var = Regread("HKLM\SYSTEM\......")

Send("$var")

So when this line comes up in the script, all that gets enterted into the text field is $var, rather than the variable itself (which should be the reg entry....

What am I missing?

  • Moderators
Posted (edited)

@ComputerName should give you what you want.

Edit: And if it is an MSI, you should be able to add the Global Variable right in the command line.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted (edited)

I have also tried....

$var = @ComputerName

Send("$var")

and again, all I get in the destination field is $var, rather than the value...

Edited by wisem2540
  • Moderators
Posted (edited)

wisem2540, are you using WinActivate to ensure the window is active before you send to it? The following works just fine for me and doesn't require creating a variable:

ShellExecute("notepad")
WinActivate("Untitled")
Send(@ComputerName)
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...