473,651 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open then Close Explorer directory using Process.Start

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 programmaticall y 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\Fon ts")newProcess. CloseMainWindow ()
newProcess.Clos e()


Feb 16 '06 #1
1 9214
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.c om> wrote in message
news:u#******** ******@TK2MSFTN GP09.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 programmaticall y 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\Fon ts")newProcess. CloseMainWindow ()
newProcess.Clos e()

Feb 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1148
by: awsok fakry via .NET 247 | last post by:
Hi All, I am trying to open a new instance of IE at the start of my C# application. When user press Start Recording... My applicaiton will close that specific instance of IE and Open a fresh IE, but if that instance is closed manually, then the App must still be able to open a new fresh IE... It give me the following erro message: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in ieObjTest.exe ...
8
1689
by: Kenneth P | last post by:
Hi, I've had a hd crash (with proper data backup) and I wonder what way would be the best way to set up an old project with all code from a backup hd in a new vs.net2003 environment? TIA Kenneth P
6
6751
by: Daniel | last post by:
Hi all, Can i open and edit the excel sheet on web page after downloading? After editing, i close the web page and the excel file auto upload to the server. Is it possible? I really struggling about the ability. If not, what advice can u provide? thank you in advance. ur help will be appreaciated.
13
1615
by: Mike Fellows | last post by:
im trying to open a directory (as if i had browsed to the directory in windows) from code im checked system.io.directory but there doesnt seem to be an open command (or similar) is there an easy way to do this? thanks
7
2005
by: jonathandrott | last post by:
sorry newbie question probably. i'm trying to open an specific folder. open each file with in the folder individually and process each one. all the processing code has been written. i'm looking for sample code to open the folder and start grabbing files. thanks.
0
2597
by: Paul Brady | last post by:
I volunteer at a youth ministry agency and help them with their student database. They have two computers, both running Windows XP. Both have Office 2002 installed without Access, except that Computer A had A97. They wanted both computers to be able to use the database, stored on Computer A. I can't get them to do that, and it seems to be a network problem. I installed A2K on each computer, putting it in a special directory which I...
1
10740
by: =?Utf-8?B?UmFndQ==?= | last post by:
Hi All I am trying to open a folder ( "D:\screenshots") by clicking a button in the web page, which opens the directory/folder in windows explorer in VS. But if i deploy the same application and install it, the same code doesnot work. The code i have written is as follows: Protected Sub Open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Open.Click Dim sFolderString As String
0
5088
by: mix01 | last post by:
Hi, I am trying to get some VBA code working, but am preplex as to why it does not work. I would really appreciate any level of help. Many thanks, Mix01 Version of the program
1
4470
by: acmdo | last post by:
Hello, The following question is about the name of file, with commas and periods, using VB.net 2005 when I try to use the process.start instruction I can open a file in explorer with process.start("explorer.exe", "/n,/e,/select" & fullpath) but I do not know how to open the files when the name is some thing like "xxxxxx, yyyy - aaaa -bbbb.pdf" The letters are any letters. When I try to execute the command ...
0
8277
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.