Close a window opened by a Shell command in VB

  • Thread starter Thread starter mpfohl
  • Start date Start date
M

mpfohl

In my VB code, I open a folder with the shell command, but i want to
be able to close it.

here is what i have:


Set oShell = WScript.CreateObject ("WSCript.shell")

oShell.run ("MyTextFile.txt")

[..other code..]

oShell.Close '<-- this doesn't work.


How do i close the 'myTextFile' that I opened earlier?

I also could do the above code as a batch file, so if the language for
that is easier, i'd do it in that. just let me know.
 
Back
Top