Jump to content
Sign in to follow this  
wisem2540

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

Recommended Posts

wisem2540

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?

Share this post


Link to post
Share on other sites
JLogan3o13

@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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
wisem2540

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

Share this post


Link to post
Share on other sites
wisem2540

removing the quotes on VAR fixed it!!

thanks!!

  • Like 1

Share this post


Link to post
Share on other sites
JLogan3o13

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

√-1 2^3 ∑ π, and it was delicious!

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  

×