Getting a SHELL program to run invisibly 
Author Message
 Getting a SHELL program to run invisibly

My Visual Basic Windows program needs to shell a DOS program.

I've tried all combinations of SHELL("prog", paprameter) but while one causes
the MS-DOS icon to appear at the bottom of the screen it doesn't seem to give
focus to the DOS program to run.

All other parameters seem to cause the DOS program to appear full screen until
it's finished. It looks MESSY!

Can anybody help?

Scott

P.S. It's a standard VB form not MDI.

=====================================================
Scott Hatton, AT&T GIS, Dundee, Scotland
=== http://www.*-*-*.com/
Some look at constitutions with sanctimonious reverence, and deem them like
the ark of the Covenant; too sacred to be touched. They ascribe to the men
of the preceding age a wisdom more than human, and suppose what they did
to be beyond amendment... laws and institutions must go hand in hand with
the times.                         -  Thomas Jefferson



Mon, 12 Jan 1998 03:00:00 GMT  
 Getting a SHELL program to run invisibly

Quote:

>My Visual Basic Windows program needs to shell a DOS program.

Try the following:

Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, ByVal
nCmdShow As Integer) As Integer

Global Const SW_HIDE = 0

' ShellStr contains the command line you want to run:

    i = WinExec("dosprmpt.pif /c  " & ShellStr, SW_HIDE)

--
Jim Gilbert                    all normal disclaimers about my opinions

Monsanto Co., St. Louis, MO



Mon, 12 Jan 1998 03:00:00 GMT  
 Getting a SHELL program to run invisibly

--
David Ullrich



Tue, 13 Jan 1998 03:00:00 GMT  
 Getting a SHELL program to run invisibly

Quote:
>My Visual Basic Windows program needs to shell a DOS program.

>I've tried all combinations of SHELL("prog", paprameter) but while one causes
>the MS-DOS icon to appear at the bottom of the screen it doesn't seem to give
>focus to the DOS program to run.

>All other parameters seem to cause the DOS program to appear full screen until
>it's finished. It looks MESSY!

        Hit the wrong button just then...
        You can make a Windows program run in an invisible window by saying
WinExec(commandline,0) - works except when the program refuses to cooperate.
But I don't think this works for DOS programs.
--
David Ullrich


Tue, 13 Jan 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Running a DOS program invisibly 2

2. Running a DOS program invisibly

3. Shell program: running IE in Shell

4. Code run invisibly

5. Running Word invisibly

6. Getting output from Dos Shell program

7. Run programs by Wscript.shell

8. Running a DOS program as a Shell (PkUnzip) from VB

9. Running a program after another using shell statement

10. Running Programs in DOS Shell

11. Returning a value from a program that is running using the Shell command

12. redirect output of program run with shell command

 

 
Powered by phpBB® Forum Software