Sign in to follow this  
Followers 0
wisem2540

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

6 posts in this topic

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



You are sending a litteral string = $var. Remove the quotes to send the variable.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

#3 ·  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

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

Share this post


Link to post
Share on other sites

#4 ·  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

Share this post


Link to post
Share on other sites

removing the quotes on VAR fixed it!!

thanks!!

1 person likes this

Share this post


Link to post
Share on other sites

#6 ·  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

√-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  
Followers 0