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

Author Topic: Alt+Tab Batch File  (Read 24274 times)

0 Members and 1 Guest are viewing this topic.

n21roadie

  • Guest
Alt+Tab Batch File
« on: March 08, 2006, 06:07:21 PM »
Hi,

I am looking for a batch file that will perform alt+tab function on the keyboard ? :-?

Many Thanks
N21Roadie

GuruGary



    Adviser
    Re: Alt+Tab Batch File
    « Reply #1 on: March 08, 2006, 10:48:28 PM »
    What is your goal?  There is probably an easier / better way to accomplish your final task, but to answer your question, here is a way to Alt+Tab (batch VB from bat) ... just put this code in a .bat or .cmd batch file and run:
    Code: [Select]
    @echo off
    echo set WshShell = CreateObject("WScript.Shell") >alttab.vbs
    echo WshShell.Sendkeys "%%{TAB}" >>alttab.vbs
    cscript alttab.vbs
    del alttab.vbs

    n21roadie

    • Guest
    Re: Alt+Tab Batch File
    « Reply #2 on: March 09, 2006, 07:39:12 AM »
    Thanks for the reply,

    I want to auto refresh with a script file ran from the task scheduler, the focus on a open program on the desktop,the program in question is a logger program and if the focus goes off the program , it will not record the next hour ?,
     

    Another question is it possible to auto-refresh to that program , if there is other programs open on the desktop ?

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Alt+Tab Batch File
    « Reply #3 on: March 09, 2006, 08:01:51 AM »
    Code: [Select]
    @echo off
    echo set WshShell = CreateObject("WScript.Shell") > Activate.vbs
    echo WshShell.AppActivate("Window Title") >> Activate.vbs
    wscript Activate.vbs
    del Activate.vbs

    Change Window Title to whatever the logger window uses. Another solution would be to sleep the vbscript and at regular intervals loop to re-activate the logger application.

    Good luck.  8-)

    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein