Kill/Name function don't work after shell commands 
Author Message
 Kill/Name function don't work after shell commands

I have an application which shells to several DOS executables. This works fine,
but after the shell statements (in the same procedure) I use 'kill' and 'name'
to get rid of some of my DOS outputs and move files to other directories. The
problem is these functions don't do anything.

I solved the problem by putting the shell statements in a general proc and
putting a call to it. I'm still curious - why wouldn't  'kill' work in the same
proc?

On a related shell topic - how do you redirect the output in a shell command?
I tried putting CHDIR right before the shell, but this did nothing.  

Thanks for any help.

- Mark English



Sat, 30 Jan 1999 03:00:00 GMT  
 Kill/Name function don't work after shell commands


Quote:
>On a related shell topic - how do you redirect the output in a shell command?

Shell("c:\command.com /c yourcommand > yourtext")

--
VB Info: http://www.sn.no/~balchen/vb/visual.htm
FAQ: http://www.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://www.sn.no/~balchen/vb/kb.htm



Sat, 30 Jan 1999 03:00:00 GMT  
 Kill/Name function don't work after shell commands


Quote:
>Shell("c:\command.com /c yourcommand > yourtext")
>--

Is there a way to find the drive and path to an EXE that can be used
to shell to a program?   I was hoping there was a way to look in the
Registry in WIN95 using VB4.0 and get a path there, instead of
searching all system drives for an instance of the EXE name.

I just want to click the button and have the app load and run.  I
think a search would make for a slow load time?



Sat, 30 Jan 1999 03:00:00 GMT  
 Kill/Name function don't work after shell commands


Quote:
> >Shell("c:\command.com /c yourcommand > yourtext")
> Is there a way to find the drive and path to an EXE that can be used
> to shell to a program?   I was hoping there was a way to look in the
> Registry in WIN95 using VB4.0 and get a path there, instead of
> searching all system drives for an instance of the EXE name.

If you mean you want the user to click a button that says Netscape, and
then Netscape loads, you should ask the user to give the location of the
EXE.

If you want to run the program associated with a certain file type, and
make it load the file, you cn use the ShellExecute API (maybe it's called
ShellExecuteA in Win95).

--
VB Info: http://www.sn.no/~balchen/vb/visual.htm
FAQ: http://www.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://www.sn.no/~balchen/vb/kb.htm



Sun, 31 Jan 1999 03:00:00 GMT  
 Kill/Name function don't work after shell commands

As soon as the shell executes (begins), the code following is
executed, unless you're using the GetModuleUsage API (Win-16) or the
WaitForSingleObject API (Win-32) to suspend your VB app until the
shell has completed.  As the code to kill is therefore probably
trying to delete the file while it's opened by the shelled app, it
fails.  If you have an error handler in the routine, you're probably
not notified of the failure.  Comment out the errorhandler On Error
statement, and see if you get a share violation.



Sun, 31 Jan 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Some Shell commands don't work

2. Cursor keys don't work in the command window when debugging

3. VB Basic Draw Commands Don't work.

4. shell command with space in path/file name does not work

5. shell command with space in path/file name does not work

6. String extract functions, left,right.mid don't work

7. Date, Trim, STR Functions Don't Work

8. Function keys don't work until I display help

9. Functions don't work in VB5?

10. BUG: VB4(16 bit) - Int and Fix functions don't work correctly

11. MovePrevious don't work but the MoveNext work's fine

12. Shell command doesn't work under WinNT

 

 
Powered by phpBB® Forum Software