Click to See Complete Forum and Search --> : question


lindawqu
July 17th, 2001, 09:24 AM
In ABC program, I use 'shell' to run b.exe program. How to close the program b.exe in ABC program. thanks

Harini
July 17th, 2001, 11:40 AM
Use the kill option in the shell statement
Shell(path of b.exe -kill)

Thanks
Harini

rayxu
July 17th, 2001, 01:38 PM
thanks

but It didn't work. Maybe my code is not correct.

Dim RetVal
RetVal = Shell("C:\temp.exe" - Kill)

Please tell me what was wrong. thanks

Harini
July 17th, 2001, 02:29 PM
Hello,

Give it as Shell("C:\Temp.exe -kill")

Thanks
Harini

Ghost308
July 17th, 2001, 02:41 PM
This is easy and will work if it is a typical Windows app that you are trying to close.


retval = Shell("notepad.exe", 1)
SendKeys "%{F4}"

lindawqu
July 17th, 2001, 02:47 PM
thanks.

It still didn't work. Instead of closing the .exe file, it opened another one.

my os: windows 98
version: vb 6

I don't know why.

Harini
July 17th, 2001, 04:32 PM
Hello,

Try writing the path of the string along with the kill option into a string and then pass it to shell

dim strPath as string

strPath="C:\temp.exe" + " -kill"
result=shell(strpath)





Thanks
Harini