How to have access on Keboard keys using batch files -
I need to execute CTRL+o or Windows key+ M to minimize all open
windows and ALT + TAB to switch between windows using a single batch
file.
I'm trying to fix it terribly. Any help on this..?
Thanks in advance....
>How to have access on Keboard keys using batch files -
Batch has no inherent way of doing that. You can do it with VBscript,
but AutoIt is easier to use:
http://www.autoitscript.com/autoit3/index.shtml
>I'm trying to fix it terribly. Any help on this..?
Yes, sending keystrokes is always a terrible solution. There is
usually a better way to solve a specific problem.
--
RoRo
> On Sat, 18 Oct 2008 23:06:18 -0700 (PDT), mus...@gmail.com wrote:
> >How to have access on Keboard keys using batch files -
> Batch has no inherent way of doing that. You can do it with VBscript,
> but AutoIt is easier to use:
> http://www.autoitscript.com/autoit3/index.shtml
*** One might also use a keystacker. I have done that within batch
files. One might also use CHOICE or XSET to accept user keyboard input,
but I suspect that is not what the original poster wants.
> >I'm trying to fix it terribly. Any help on this..?
> Yes, sending keystrokes is always a terrible solution. There is
> usually a better way to solve a specific problem.
> --
> RoRo
*** You are probably right, but I have used the above methods for so
long, that I have never thought about an alternate technique.
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
For example, using a little Windows Scripting in a hybrid batch
procedure ...
@echo off
echo CreateObject("Shell.Applications").MinimizeAll > %temp%\tmp.vbs
echo CreateObject("Wscript.Shell").Sendkeys "%%{TAB}" >> %temp%
\tmp.vbs
for %%a in (cscript del) do %%a %temp%\tmp.vbs
Of course, a VBS script could do this just as well, without resorting
to a batch (but this is a batch group).
If we knew exactly what the desired outcome was, it might be possible
to better tailor the script/batch to the problem.
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
There are programs to control Windows & DOS programs both, a great help for
you should be to search for Sendkeys, if you have Visual Basic you can write
a program using Sendkeys to control Windows programs, when I wrote one of my
batch files I just needed to have the batch file send the return key to a
antivirus program, oh, it was Avira Antivir & this worked:
echo ~| "C:\Program Files\Avira\AntiVir PersonalEdition Classic\avcls.exe"
%1
In Visual Basic it is easy to make a program to automate the Windows
programs, you would use Paint to use this...
Private Sub Form_Load()
RetVal = Shell("C:\Program Files\Norton Utilities\WINDOC.EXE", 1) 'Run
Norton WinDoctor.
SendKeys "{ENTER}", True 'Hit Enter
Unload Form1
I never did try doing Sendkeys in any Basic version for DOS but it uses
Shell instead of RetVal
Well, have a good one!
http://www.filegod.netfirms.com
YEAH..
Im the author of this thread..
Atlast I have no other option to use rather that sendkeys..
It worked with vbs only..
Thanks to every one..
Regards,
Mannoj
>For example, using a little Windows Scripting in a hybrid batch
>procedure ...
Here is another way to make a hybrid BAT/VBS file:
Write the VBS, but save it with .BAT as file extension, and insert
this line at the very top(single line):
set dummy=nothing:rem&cscript "%0" //E:VBS //NOLOGO&set dummy=&GOTO
:EOF
Although it leaves a few problems, and is not obviously useful, I
still think it's a little cool.
--
RoRo