The online racing simulator
#1 - FL!P
Preventing LFS from losing focus when using /exec?
I wrote a batch file that allows to have different sets of custom views and switch between them from inside LFS (see here). It works by having several views folders and renaming them to change the active one. I run it from LFS via the /exec command.

It works fine except for one detail: if LFS is in windowed mode when I trigger the script, a Terminal window briefly flashes on the screen as the batch is executed. Not a big problem, but not the best behavior either. However if I run that script when LFS is in full screen, LFS then loses focus and gets minimized to the tasks bar. Obviously, this is a bigger problem.

I'm not sure if this is a bug or a feature (might be for security reasons) but it's annoying and somehow defeats the usefulness of /exec. Is there a way to prevent LFS from losing focus, in this case? A way to run batch files in "silent" mode, maybe?
Had same problem: http://www.lfsforum.net/showthread.php?p=427928#post427928

It seems losing focus is impossible to prevent ATM, unless program that is run creates its window in some sort of "silent" way (dunno I'm not familiar with winzozz programming). It is possible to exec programs in a way that window is created somehow on background, seen it done in other programs (AutoGK for example).
The problem is that dos can't run in silent mode, it has to create a dos window.

You can use WScript which has similar functionality with dos or try Autohotkey http://www.autohotkey.com/ because they can run in silent mode (with no window).
So no focus problems with those

Autohotkey needs a little reading but it has saved the day for me in several ocasions. I use it all the time with lots of programs including LFS. After a week with it you'll never go back to dos again
#4 - FL!P
Cool, I'll give it a try. Thank you!

Update: I did. AutoHotkey is very nice indeed! And it works fine, as long as you compile the script (making an exe of it) and call that from LFS. Because LFS' /exec command fails to execute the .ahk files with an "invalid parameter" error. I guess it doesn't know that these are executable files.

Anyway, I'm now using AutoHotkey for my CustomViewsSwitch thingie and it works perfectly. So thanks a lot for pointing it out!
Is AutoHotkey somehow related to Auto It? They seem very similar.
Just taking a quick look at both, it looks like AutoIt is much more Feature filled than AutoHotkey
Quote from Peptis :Is AutoHotkey somehow related to Auto It? They seem very similar.

I didn't know about Auto It so far.

Autohotkey is free, powerful and is a great substitute for WScript I was using before it. I didn't have any problems or dead ends with it so far (about a year now) so I didn't look for alternatives.

I'll have a look at Auto It in the future, so I suggest to beginners to try them both then
#8 - FL!P

FGED GREDG RDFGDR GSFDG