Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: i need a basic bat file...  (Read 2873 times)

0 Members and 1 Guest are viewing this topic.

generikk

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 7
    i need a basic bat file...
    « on: March 15, 2013, 04:35:49 AM »
    ok i need a basic bat file i need it to be able to send an emulated press of a key (up arrow) to the active window every 10-20 secs (random)
    if u make one email it to me at [email protected]

    -generikk

    email addy removed to prevent SPAM.
    « Last Edit: March 15, 2013, 06:48:42 AM by patio »

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: i need a basic bat file...
    « Reply #1 on: March 16, 2013, 02:11:19 PM »
    A batch file (basic or otherwise) does not have the built-in functionality to send key strokes.

    Your Win7 machine has tools to do this however. Alternatives would be a VBScript using the sendkeys method of the shell object. Powershell would be overkill, but you can send key strokes with the Windows.Forms class. A third party alternative would be to download and install AutoIt.

     8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: i need a basic bat file...
    « Reply #2 on: March 16, 2013, 03:41:33 PM »
    Just curious as to application of this?

    Most automation has specific timing involved where you dont want random between 10 and 20 sec intervals.