Jump to content

(send) hostname/computername to field, should I used regread?


 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • Moderators

@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!

Link to comment
Share on other sites

  • Moderators

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!

Link to comment
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
 Share

  • Recently Browsing   0 members

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