Start dos batch file from a VB application 
Author Message
 Start dos batch file from a VB application

Hello friends !!
I am struggling with the problem as described here under:

I use a software application which runs under Dos ON MY File and Database
Server using NT 4.0 ( I first have to open a Dos box on my Server).

Every part of the application has it's own batch file to start with.
Example of the contents of one of the batch files is called Grd200.bat and
hereunder are it's contents:

call %bat%\delete.bat %eigen%\grd200SET PRNTOUT=%eigen%\grd200
SET S=00010000
CALL %bat%\execute GRD20025
:EINDE

This starts a program ( GRD20025 ) which can handle product number
maintenance.

What I normally do is the following:

Click on the Dos prompt and a Dos box is opened.
Start the batch file by typing it's name ( name = GRD200.bat ) and hit the
Enter key.
Now I can work with the application that starts with this batch file; after
exiting the application I come in my dos prompt again
I type EXIT and Windows is 'on the run' again.

I wanted to write a Menu application for this because starting up all these
batch files under dos is not a workable situation for a user.   Therefor I
have developed an application with Visual Basic 6.0 and have build a Menu
with the Menu Editor  ( MDI form ).

From that Menu I start a batch file with the following purpose:

Open a Dos box and start start the batch file (GRD200.bat)
Shrink the VB application ( show it down under on the task bar as an icon )
After exexcution of the contents of the batch file: close my Dos box again ;
enlarge my VB Menu application again.

Herewith is a print of the code as used; however : something happens but my
batch file doesn't seem to be started; I never get the application ( see
batch file ) running;, so:

Who can help me writing the right VB code for this problem??       Code:

Private Sub MenGrb200_Click()
Rem:  opstarten vanuit directory op Server Bl3:   U:\Acc9\Bats\Grd200.bat
Rem:  U is directory on my File Server were all batch files ar located
Dim A
A = Shell   ("U:\Acc9\Bats\Grd200.bat ", 3)

End Sub

Many thanks for he / her who can help me solve this problem please send me a
mail message.
Best regards, Jan Noomen

Telefax. +31 229 275374



Sat, 07 Apr 2001 03:00:00 GMT  
 Start dos batch file from a VB application
Jan,

Trap any error conditions and see what the Err.Number and Err.Description
is. This
will give you a clue as to why things are failing. So after you "Shell"
statement,
put --
    If Err.Number <> 0 Then
        Msgbox Err.Number & "-" & Err.Description
    End If

-Jay

Quote:

>Hello friends !!
>I am struggling with the problem as described here under:

>I use a software application which runs under Dos ON MY File and Database
>Server using NT 4.0 ( I first have to open a Dos box on my Server).

>Every part of the application has it's own batch file to start with.
>Example of the contents of one of the batch files is called Grd200.bat and
>hereunder are it's contents:


>call %bat%\delete.bat %eigen%\grd200SET PRNTOUT=%eigen%\grd200
>SET S=00010000
>CALL %bat%\execute GRD20025
>:EINDE

>This starts a program ( GRD20025 ) which can handle product number
>maintenance.

>What I normally do is the following:

>Click on the Dos prompt and a Dos box is opened.
>Start the batch file by typing it's name ( name = GRD200.bat ) and hit the
>Enter key.
>Now I can work with the application that starts with this batch file; after
>exiting the application I come in my dos prompt again
>I type EXIT and Windows is 'on the run' again.

>I wanted to write a Menu application for this because starting up all these
>batch files under dos is not a workable situation for a user.   Therefor I
>have developed an application with Visual basic 6.0 and have build a Menu
>with the Menu Editor  ( MDI form ).

>From that Menu I start a batch file with the following purpose:

>Open a Dos box and start start the batch file (GRD200.bat)
>Shrink the VB application ( show it down under on the task bar as an icon )
>After exexcution of the contents of the batch file: close my Dos box again
;
>enlarge my VB Menu application again.

>Herewith is a print of the code as used; however : something happens but my
>batch file doesn't seem to be started; I never get the application ( see
>batch file ) running;, so:

>Who can help me writing the right VB code for this problem??       Code:

>Private Sub MenGrb200_Click()
>Rem:  opstarten vanuit directory op Server Bl3:   U:\Acc9\Bats\Grd200.bat
>Rem:  U is directory on my File Server were all batch files ar located
>Dim A
>A = Shell   ("U:\Acc9\Bats\Grd200.bat ", 3)

>End Sub

>Many thanks for he / her who can help me solve this problem please send me
a
>mail message.
>Best regards, Jan Noomen

>Telefax. +31 229 275374



Sun, 08 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Start dos batch file from a VB application

2. Start dos batch file from a VB application

3. Start dos batch file from a VB application

4. VB DOS: Start Batch file after unloading app?

5. DOS Batch File to Copy Files from an Access Application

6. Help: hiding a DOS window when executing a DOS batch file

7. question on hiding a DOS window when executing a DOS batch file

8. How do I call a ms-dos batch file from VB

9. running multiple dos batch files from VB...

10. Return value from VB executable to DOS batch file

11. VB call to DOS Batch Files

12. VB and DOS Batch Files

 

 
Powered by phpBB® Forum Software