Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WinXP C# Windows Win7 API
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
System.Diagnostics.Process.Start("E:\\");
but this code opens a new window... I want to change not open a new window.
Posted 4-Sep-12 8:15am
soox419
Edited 4-Sep-12 8:22am
v2
Comments
Sergey Alexandrovich Kryukov at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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'.
  Permalink  
Comments
Sandeep Mewara at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I don't know a way to change navigation bar value, but you can open directory using
 
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.
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.150301.1 | Last Updated 4 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100