In ABC program, I use 'shell' to run b.exe program. How to close the program b.exe in ABC program. thanks
Printable View
In ABC program, I use 'shell' to run b.exe program. How to close the program b.exe in ABC program. thanks
Use the kill option in the shell statement
Shell(path of b.exe -kill)
Thanks
Harini
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
Hello,
Give it as Shell("C:\Temp.exe -kill")
Thanks
Harini
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}"
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.
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