|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Open then Close Explorer directory using Process.StartWhat 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() 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. Show quoteHide quote "Mike Kober" <mko***@wi.rr.com> wrote in message news:u#w2y4yMGHA.1312@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() > > > >
by default, public or private?
Getting current user name Reference to a variable need help on DateDiff function! Getting Color Depth / Quality of display adpater / screen Treeview, Which collection object to use similar to SortedList\Hashtable BindingSource.AddNew Property of List of Classes Is it possible to have different columns of a datagrid bound to different datatables? |
|||||||||||||||||||||||