wisem2540 Posted February 16, 2012 Posted February 16, 2012 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?
jdelaney Posted February 16, 2012 Posted February 16, 2012 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.
Moderators JLogan3o13 Posted February 16, 2012 Moderators Posted February 16, 2012 (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 February 16, 2012 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!
wisem2540 Posted February 16, 2012 Author Posted February 16, 2012 (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 February 16, 2012 by wisem2540
wisem2540 Posted February 16, 2012 Author Posted February 16, 2012 removing the quotes on VAR fixed it!! thanks!! jdelaney 1
Moderators JLogan3o13 Posted February 16, 2012 Moderators Posted February 16, 2012 (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 February 16, 2012 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now