how to get the cmd window to close in VBA??

  • Thread starter Thread starter Simon Lloyd
  • Start date Start date
S

Simon Lloyd

I have written some code to open a program on a PC when a certai
condition exists, this works fine and does the job, however the cm
window is still left open after this operation anyone know how to clos
it in VBA???

Here's the code i use.....

shell("cmd /k C:\notes\notes.exe")

where notes is the program to open.


Simo
 
I have written some code to open a program on a PC when a certain
condition exists, this works fine and does the job, however the cmd
window is still left open after this operation anyone know how to close
it in VBA???

Here's the code i use.....

shell("cmd /k C:\notes\notes.exe")

where notes is the program to open.


Simon

Remove the "/k" - that specifically tells cmd.exe to run the program you
specify and then remain open. In fact, you should really remove "cmd"
entirely and just do
shell "c:\notes\notes.exe"
 
I tried removing the K/ switch the cmd program launched but did nothin
else....just hung there......is there another solution?

Simo
 
shell("cmd /C C:\notes\notes.exe")

/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
 
shell("cmd /C C:\notes\notes.exe")

/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains

....or do as I said: remove "cmd" entirely and just shell straight to
Notes.
 
Back
Top