straytoasters Posted February 3, 2006 Posted February 3, 2006 I am needing to essentially just push the OK button from a .bat (a .vbs call is acceptable as a second option). Is there some kind of sendkey equlivent for .bat(s).Straytoasters
Zxian Posted February 4, 2006 Posted February 4, 2006 You could try learning AutoIt. It can handle all the stuff that you can do in batch files, as well as press buttons for you.
straytoasters Posted February 4, 2006 Author Posted February 4, 2006 Yeah. I have a friend who could make the auto it script in a minute or two. The .bat script I use so far makes about 20 or so changes and is all done with .bat commands and a .reg or two, I am trying to do all I want with as near to built in Windows componets as possible. Auto it may be my "out" but I am going to keep looking for a while. Thanks.Straytoasters
jasirw Posted February 4, 2006 Posted February 4, 2006 What i do is the following. I create my bat file and also a WSF file in which i have my VB code An example is the following, i use it to install clonedvd. It is the complete script and simply sends the ALT-N combination to the program.<Job id="keystrokes"> <script language="VBScript"> Set objShell = WScript.CreateObject("WScript.Shell") objShell.run("SetupCloneDVD2.exe /S") WScript.Sleep 16000 objShell.AppActivate "CloneDVD2 Setup" WScript.Sleep 100 objShell.SendKeys "%(N)"</script></Job>I have this file named as keystrokes.wsf and call it from my bat file usingcscript keystrokes.wsfI hope this helps
nmX.Memnoch Posted February 4, 2006 Posted February 4, 2006 Yeah. I have a friend who could make the auto it script in a minute or two. The .bat script I use so far makes about 20 or so changes and is all done with .bat commands and a .reg or two, I am trying to do all I want with as near to built in Windows componets as possible. Auto it may be my "out" but I am going to keep looking for a while. Thanks.StraytoastersYou can compile the AutoIt script into an executable. This keeps you from having to install AutoIt on machines just to run the scripts. This is how I do my unattended installs where key presses are required. You can even have it disable the keyboard/mouse while it's running so that nothing interferes with the keys you send.
straytoasters Posted February 5, 2006 Author Posted February 5, 2006 Yep, thats what I did for now as a workaround...but I still looking. Thanks.Straytoasters
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now