Winbatch SendKeys Function
Anyone out there with some decent Winbatch skills? I'm trying to integrate an .xml file to Integrity Agent 6 (which will need to be pushed out via SMS) and unfortunatly there is an unavoidable prompt before this happens to either accept or not accept. I've tried various functions to get Winbatch to recognize the window and send the enter key to it, but the script has either errored out or has just simply ignored this window. If anyone can provide some advice as soon as they can I would appreciate it. Thanks.
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
rpfenninger
18 years ago
We prefer using AutoIT to achieve those kinds of tasks. Check this link for more information.
With a simple two lines script (which you can compile into a self executing .exe file) you can answer such dialog boxes.
Send me a screen shot of that dialog and tell me the way you want it answered and I'll provide you that script.
Cheers
Roland
With a simple two lines script (which you can compile into a self executing .exe file) you can answer such dialog boxes.
Send me a screen shot of that dialog and tell me the way you want it answered and I'll provide you that script.
Cheers
Roland
Posted by:
danr29
18 years ago
Roland;
I was trying to use AutoIT to accomplish this but had problems with the command line I was trying to use in conjunction w/ the program I was launching. I was trying to launch the program by path (i.e. $PROGFILESDIR$\(program dir)\(nameofprogram).exe). The next part was a command line used to modify the application (-config (pathtofile)\ServerIP.xml). Launching the executable by path I had no problem. But trying to incorporate the command line w/ it I could not figure out. I know how to use AutoIT to send keys to windows, but if you could help me w/ the correct syntax for the command line to be used w/ the application I would really appreciate it. Thank you.
I was trying to use AutoIT to accomplish this but had problems with the command line I was trying to use in conjunction w/ the program I was launching. I was trying to launch the program by path (i.e. $PROGFILESDIR$\(program dir)\(nameofprogram).exe). The next part was a command line used to modify the application (-config (pathtofile)\ServerIP.xml). Launching the executable by path I had no problem. But trying to incorporate the command line w/ it I could not figure out. I know how to use AutoIT to send keys to windows, but if you could help me w/ the correct syntax for the command line to be used w/ the application I would really appreciate it. Thank you.
Posted by:
rpfenninger
18 years ago
Obviously, I didn't get your point. I thought it was all about answering a simple dialog box.
However, what are you exactly trying to do? Why do you want to put all those commands into a script?
Or is your problem about how to start the executable (script) from within the msi???
Sorry 'bout that.
Roland
However, what are you exactly trying to do? Why do you want to put all those commands into a script?
Or is your problem about how to start the executable (script) from within the msi???
Sorry 'bout that.
Roland
Posted by:
danr29
18 years ago
I apologize for the confusion. To explain in further depth, I am trying to update an application called Integrity Agent 6. We have to update the policy currently used by using the lengthy command line I have posted in the previous post. There's no other way around it. It's already in an .msi format so I'm not editing the .msi in any way. Not to mention, there's no way to suppress the prompt that pops up when doing this asking the user whether or not to accept this change. Does this help?
Posted by:
rpfenninger
18 years ago
Ok, now I see why you don't want to do this within the .msi because it's a vendor .msi!
Can SMS be used to start another program together with your .msi deployment or do you want the users to start the script through a Login Script?
I just checked the AutoIT page for the commands and found the following:
1) To answer the dialog box:
WinWaitActive("title of the dialog box")
Send("{ENTER}")
(i.e. to send an "Enter" as you mentioned in your first post)
2) To start another program:
Run ( "filename" [, "workingdir" [, flag]] )
But I guess, that's what you've found already.
If it was a repackaged .msi you could have integrated that script as a Custom Action.
Can SMS be used to start another program together with your .msi deployment or do you want the users to start the script through a Login Script?
I just checked the AutoIT page for the commands and found the following:
1) To answer the dialog box:
WinWaitActive("title of the dialog box")
Send("{ENTER}")
(i.e. to send an "Enter" as you mentioned in your first post)
2) To start another program:
Run ( "filename" [, "workingdir" [, flag]] )
But I guess, that's what you've found already.
If it was a repackaged .msi you could have integrated that script as a Custom Action.
Posted by:
bluebearr
18 years ago
I wouldn't touch the vendor MSI for Integrity, because I've had things break that way. Besides, everything can be done through the command line.
I wrote an app in AutoIt to respond to the prompt. Note that for some versions of Integrity, it works better to send an {ENTER} to the window, and for others it works better to send alt-y or to click the control. I'd experiment with the version that you have.
The "real" way to so it, though, is to set an install password. That way, when you update you can specify the install password and then you don't have to click the prompt.
Your installation command line is something like this:
and then your reconfiguration looks like this:
This is documented in the Integrity Client Management Guide, which you should get from the vendor if you don't have it.
BlueBearr
I wrote an app in AutoIt to respond to the prompt. Note that for some versions of Integrity, it works better to send an {ENTER} to the window, and for others it works better to send alt-y or to click the control. I'd experiment with the version that you have.
The "real" way to so it, though, is to set an install password. That way, when you update you can specify the install password and then you don't have to click the prompt.
Your installation command line is something like this:
IclientSetup_IFen.exe /s /v"/qn INSTALLPASSWORD=installpword CONFIGFILE=\"C:\path\config.xml\""
and then your reconfiguration looks like this:
iclient.exe -pwinst installpword -config "C:\reconfig.xml"
This is documented in the Integrity Client Management Guide, which you should get from the vendor if you don't have it.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.