Gray Posted November 9, 2007 Share Posted November 9, 2007 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 comment Share on other sites More sharing options...
cluberti Posted November 9, 2007 Share Posted November 9, 2007 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 comment Share on other sites More sharing options...
Gray Posted November 10, 2007 Author Share Posted November 10, 2007 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 comment Share on other sites More sharing options...
cluberti Posted November 10, 2007 Share Posted November 10, 2007 The only way I can think of would be to use something like cmdow.exe to hide (minimize) the command prompt immediately after it starts. Link to comment Share on other sites More sharing options...
Gray Posted November 11, 2007 Author Share Posted November 11, 2007 The only way I can think of would be to use something like cmdow.exe to hide (minimize) the command prompt immediately after it starts.Hmmm... But wouldn't cmdow then have the focus? Link to comment Share on other sites More sharing options...
cluberti Posted November 11, 2007 Share Posted November 11, 2007 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 comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now