Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

Window Focus


Recommended Posts

Hi,

I need to run a batch file periodically, but I don't want the batch file to steal the focus.

Is it possible in NT to either run something purely in the background that doesn't steal the current windows focus, or is there a way to run a batch file that steals the focus, and then return the focus to where it was before?

Cheers,

Gray

Link to post
Share on other sites

Can you write your batch as a vbscript instead? If you can, and it requires no input, you can run it with cscript and it will always run in the background and never steal focus (unless it needs user input, which I'm guessing your batch does not).

Link to post
Share on other sites
Can you write your batch as a vbscript instead? If you can, and it requires no input, you can run it with cscript and it will always run in the background and never steal focus (unless it needs user input, which I'm guessing your batch does not).

Unfortunately not - I know nothing about vbscript. I just about managed doing the batch file, and that's very basic indeed! Batch files and the like are really not my area of expertise, hence my posting in this forum.

Link to post
Share on other sites

It takes it for a moment, but when the window minimizes it should go back to the active window before the command prompt is run. You'd have to try it, mind you, but it might work.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...