Solved: VB6 Shell command - BACKGROUND

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Hogskin

Thread Starter
Joined
Apr 1, 2008
Messages
2
I have an application in VB6 that triggers a .BAT file a couple times a minute using the SHELL command. The function is working fine. But a problem occurs when I am trying to perform other functions on that computer. (Some of my source code development is done on this computer.) When the COMMAND.COM box gets triggered, it wrests control from my other application momentarily, then returns it. This results in very problematic lost keystrokes.

Is there any way to keep the COMMAND.COM box from gaining foreground control? I have tried changing virtually all of the options on COMMAND.COM in the System32 directory with no success. I am hoping there may be a parameter for the SHELL command that can do this...

Alternately, if there is a way in XP to direct an application to grab control and not relinquish it to other tasks (without otherwise affecting execution of those other tasks), that would work for me.

This system is running Windows XP with SP2.

Thanks.
 
Joined
Oct 12, 2003
Messages
3,015
Use cmd.exe instead of command.com and in your Shell command, specify vbHide as the 2nd parameter. Command.com is a DOS emulator and works differently than cmd.exe which is a command interpreter. The vbHide as the 2nd parameter will keep the command prompt window from appearing.
 

Hogskin

Thread Starter
Joined
Apr 1, 2008
Messages
2
Thanks VERY much, coderitr!!! The vbHide took care of it. Apparently the Shell command was already invoking cmd.exe, which I was unaware of. This is terrific after putting up with that aggravation and associated problems for over a year.
 
Joined
Oct 12, 2003
Messages
3,015
You're welcome. You can mark this thread as solved by clicking the red & white triangle.

Welcome to TSG
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top