By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,033 Members | 1,285 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,033 IT Pros & Developers. It's quick & easy.

Open then Close Explorer directory using Process.Start

P: n/a
I'm having difficulty getting this to work. Any help would be appreciated.
What I'm trying to do is to open Explorer onto the Windows/fonts directory
and then close it. I've added a font programmatically to the directory and
found that the easiest way to refresh the folder is to just open windows
explorer. Without doing this, it isn't refreshed in the system. I had the
same problem in VB6 and VBA as with VB.net. Searching the newsgroups showed
me that this same issue exists, with no good solution from Microsoft.

If I can just get my popup window to close, I'm good to go.

Here's my code. It works to open the window, but just leaves it open. I've
tried the Waitforclose options and a variety of different things, but no
luck:
Dim newProcess As Process

newProcess = Process.Start("Explorer.exe ",
"C:\Windows\Fonts")newProcess.CloseMainWindow( )
newProcess.Close()


Feb 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Mike,

Try myProcess.Kill(). Be cautioned, though, because this method is not
recommended in most cases, since it causes abnormal program termination.

Regards,

Cerebrus.
"Mike Kober" <mk****@wi.rr.com> wrote in message
news:u#**************@TK2MSFTNGP09.phx.gbl...
I'm having difficulty getting this to work. Any help would be appreciated.
What I'm trying to do is to open Explorer onto the Windows/fonts directory
and then close it. I've added a font programmatically to the directory and
found that the easiest way to refresh the folder is to just open windows
explorer. Without doing this, it isn't refreshed in the system. I had the
same problem in VB6 and VBA as with VB.net. Searching the newsgroups showed me that this same issue exists, with no good solution from Microsoft.

If I can just get my popup window to close, I'm good to go.

Here's my code. It works to open the window, but just leaves it open. I've
tried the Waitforclose options and a variety of different things, but no
luck:
Dim newProcess As Process

newProcess = Process.Start("Explorer.exe ",
"C:\Windows\Fonts")newProcess.CloseMainWindow( )
newProcess.Close()

Feb 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.