Jump to content

[Batch and VBS] Keeping focus on Batch?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Mairu

Mairu

    Newbie

  • Members
  • Pip
  • 2 posts
Hello I need some help

I am using a Batch file to write a VBS

The VBS uses sendkeys on the Batch file

Obviously focus can be taken away from the Batch file which could cause problems

So I am asking for one of two solutions

A way to bring the Batch file into focus or only send keystrokes to that specific Batch file

Thanks in advance

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Errr... huh? You may need to post some code because it sounds like you're doing something rather strange.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Mairu

Mairu

    Newbie

  • Members
  • Pip
  • 2 posts
I don't have anything down in code yet so I'll try to make it easier to understand

User runs Batch file
-Creates a new VBS file
-Runs that VBS file

All this I can do but then...

VBS file runs
-Finds the Batch file that made it
-Simulates keyboard input in that file (If it's still running)

I hope that makes it clearer

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
No. Generally, the Batch file will be paused while the VBS file is running, so I don't see how you're doing keyboard input to the Batch file. It also sounds VERY odd to be using two different scripting systems like this.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog