Shell Function not shelling under Windows NT. 
Author Message
 Shell Function not shelling under Windows NT.

I wrote a VB App. that runs a DOS pgm via a batch file. Here is the VB
statement:

pid = Shell("MYDIR1\S1.BAT", vbMaximizedFocus)

A DOS window comes up & runs the pgm. It works fine under Windows 95.

When I try the same thing under NT.  I get the DOS window appearing on
the screen for a fraction of a second & then it disappears (even from
the task manager). The shelled pgm does not seem to run. I went as far
as changing the content of the Batch file to DIR /P expecting a pause
but I still get just a flicker of a DOS window on the screen.

Can anyone tell me why I get different results between 95 & NT?

Thanks in advance
Alex.....



Fri, 08 Jun 2001 03:00:00 GMT  
 Shell Function not shelling under Windows NT.
In your batch file add,

PAUSE

This should make it stop and you can view any errors.....


Quote:
>I wrote a VB App. that runs a DOS pgm via a batch file. Here is the VB
>statement:

>pid = Shell("MYDIR1\S1.BAT", vbMaximizedFocus)

>A DOS window comes up & runs the pgm. It works fine under Windows 95.

>When I try the same thing under NT.  I get the DOS window appearing on
>the screen for a fraction of a second & then it disappears (even from
>the task manager). The shelled pgm does not seem to run. I went as far
>as changing the content of the Batch file to "DIR /P" expecting a pause
>but I still get just a flicker of a DOS window on the screen.

>Can anyone tell me why I get different results between 95 & NT?

>Thanks in advance
>Alex.....



Fri, 08 Jun 2001 03:00:00 GMT  
 Shell Function not shelling under Windows NT.
If you trying to launch to do dir 'shell' then trying creating an
instance of cmd.exe when launching the command. i.e.

Shell "cmd.exe /c dir c:\winnt /p", <shell type>

Note: if you do not want to receive the PID of the shell, then you do
not need to variable to receive PID into. In this case, just make the
shell call without the parameters in brackets.



Quote:
>Not only that, the variable PID needs to be declared as LONG in order for a
>shell statement to work correctly.  I am sure this is already happening, but
>one cannot be sure from the source below.

<snip>
--
Rajesh Varia


Thu, 14 Jun 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Can not SHELL to BASIC - in Windows NT DOS

2. Shell works in Win98 but not in NT.

3. Shell.Application.Count or Shell.Application.Contents.Count

4. Shell & Shell Execute under NT

5. Shell with Windows NT

6. Problem with shell() under Windows NT 4.0

7. Shell Function on NT 4.0 Platform

8. Getting a PID, VB 4.0 32-bit, NT, Shell function

9. Vb4.0 to Vb6.0 windows registry - shell function

10. Shell Function and Windows Apps

11. shell function and Windows NT4.0

12. Please Help: Shell function and C++ windows app.

 

 
Powered by phpBB® Forum Software