Simulate keyboard command in batch file

Posted on 2010-01-07
Last Modified: 2012-05-08
I was wondering if it is possible to have a batch file simulate a keyboard command...namely the 'alt tab' feature for windows xp?

Any help would be greatly appreciated.
Question by:liamrichards
    LVL 35

    Accepted Solution

    A batch file cannot simulate a key stroke without the aid of external applications that it would have to call.

    If you want an easy way to this feature, consider using a Windows script instead of a batch file, or please have a look at AutoIt, a command line scripting language and keystroke simulator on steroids:
    LVL 22

    Expert Comment

    LVL 35

    Expert Comment

    I've looked into key-fake, it doesn't apply.
    1.) it only does this:
    "Purpose:  Supplies the series of keystrokes needed to
                        initialize an application program on boot-up."
    (quoted from the doc)
    2.) it's a 16bit DOS tool written in 1985, which means it cannot simply run inside a Windows batch environment. It will blank the complete desktop when called.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    A short article about a problem I had getting the GPS LocationListener working.
    This is an explanation of a simple data model to help parse a JSON feed
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now