Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi...

I want to open a directory ( like "E:\\" ) in an open window,
I mean that I want to change a window navigation address in windowsExplore.exe,

for example i have a window open that shows "D:\\new folder" and I want to change its address to "E:\\",

I know this code
C#
System.Diagnostics.Process.Start("E:\\");

but this code opens a new window... I want to change not open a new window.
Posted
Updated 4-Sep-12 7:22am
v2
Comments
Sergey Alexandrovich Kryukov 4-Sep-12 14:42pm    
If you think a bit about it, you will see that there is no such thing as "open a directory" -- this is no more than some metaphor common for some types of applications, such as file managers. By some reason, your code really opens a new window, but it's not just a window, this is a window of Windows "Explorer" application. To get some help, you really need to realize all that and explain what you want to achieve, otherwise this question makes no sense.
--SA

AFAIK, what you are trying to do is not possible this way. This is not how Process.Start works.

A folder is not a process that can be 'started'.
 
Share this answer
 
Comments
Sandeep Mewara 4-Sep-12 15:50pm    
You cannot do it. You need an event to do it. URL's are executed and directed to other ones by same web app. External applications can launch a new URL but cannot change existing windows one from security perspective. Think if it was allowed, how viruses and male-ware would do with our open windows.
I don't know a way to change navigation bar value, but you can open directory using

C#
System.Diagnostics.Process.Start("explorer.exe", @"/select, " + fileName);


If you don't want to select a file just replace @"/select, " with "".filename represents location of file or folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900