473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Open windows explorer at server path

Hi
I am trying to open windows explorer at a specific path on a server.
Path is not found
whe run. It works ok using a local path. How do i address a server?

Code as follows;
{
System.Diagnostics.ProcessStartInfo exploreTest
= new System.Diagnostics.ProcessStartInfo();
exploreTest.FileName = "explorer.exe";
exploreTest.Arguments ="\"\\servername\\path\\";
System.Diagnostics.Process.Start(exploreTest);
}
Thanks
Colin Williams

Sep 14 '06 #1
3 11618
Colin,

It's the Arguments property. It should look like this:

exploreTest.Arguments = "\\\\servername\\path\\";

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Colin Williams" <co**************@msn.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Hi
I am trying to open windows explorer at a specific path on a server.
Path is not found
whe run. It works ok using a local path. How do i address a server?

Code as follows;
{
System.Diagnostics.ProcessStartInfo exploreTest
= new System.Diagnostics.ProcessStartInfo();
exploreTest.FileName = "explorer.exe";
exploreTest.Arguments ="\"\\servername\\path\\";
System.Diagnostics.Process.Start(exploreTest);
}
Thanks
Colin Williams

Sep 14 '06 #2
Thanks Nicholas
Works great. Im having trouble getting my head round the backslash
usage for paths in C#. I must have tried everthing else but your
solution.
Kind regards
Colin


Nicholas Paldino [.NET/C# MVP] wrote:
Colin,

It's the Arguments property. It should look like this:

exploreTest.Arguments = "\\\\servername\\path\\";

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Colin Williams" <co**************@msn.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Hi
I am trying to open windows explorer at a specific path on a server.
Path is not found
whe run. It works ok using a local path. How do i address a server?

Code as follows;
{
System.Diagnostics.ProcessStartInfo exploreTest
= new System.Diagnostics.ProcessStartInfo();
exploreTest.FileName = "explorer.exe";
exploreTest.Arguments ="\"\\servername\\path\\";
System.Diagnostics.Process.Start(exploreTest);
}
Thanks
Colin Williams
Sep 14 '06 #3

For paths you could use @"" instead of just quotes which will allow
you to use individual slashes:

exploreTest.Arguments = @"\\servername\path\";

Also for most places in windows you can use a forward-slash instead

new StreamReader("c:/temp/test.txt");

Process is one of the exceptions--won't work in the original situation
you specified, but will work most places.

HTH,

Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

On 14 Sep 2006 14:04:17 -0700, "Colin Williams"
<co**************@msn.comwrote:
>Thanks Nicholas
Works great. Im having trouble getting my head round the backslash
usage for paths in C#. I must have tried everthing else but your
solution.
Kind regards
Colin


Nicholas Paldino [.NET/C# MVP] wrote:
>Colin,

It's the Arguments property. It should look like this:

exploreTest.Arguments = "\\\\servername\\path\\";

Hope this helps.
Sep 14 '06 #4

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

Similar topics

2
by: Éric GARANT | last post by:
Hello everyone, I can't open ASP documents with Windows 2000 Pro french version SP4 + IE6.0 SP1 + IIS 5.0. When I click an ASP file, it's FrontPage 2000 that opens it. If I choose Open With......
4
by: Chuck Anderson | last post by:
I use apache, Php and MySql on my Windows XP machine at home. I have been doing so successfully now for a long time. However, I am now trying to use fopen to open secure URLs (https) and having...
1
by: Brian | last post by:
I have a complex problem that needs a lot of background explanation before I can ask questions, so here goes.... Our system consists of two servers. -WebUI server - Windows 2000 - runs asp.net...
3
by: Aaron | last post by:
My application will only be used on windows based machines. I need to open a folder using UNC naming. i.e. \\server\share\folder I do not need to do anything programatically with the folder...
6
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...
13
by: Chris Johnson | last post by:
I have what seems to be such a simple thing yet I cannot figure out how to do it. I am using a streamwriter to build a text file. At the end of the process I want to open that same text file in...
6
by: mardif | last post by:
Hi guys. I've a very big big big problem: I've in my windows computer a file named cicciobello.html, located in c:\documents and settings\username\desktop\cicciobello.html. Now, I MUST open...
1
by: Dachshund Digital | last post by:
If Explorer can display a file path longer than 260 odd characters, why is it that System.IO.File.Open Method can not? Calling GetFiles from my.computer.fileystem can return paths longer but...
24
by: dancer | last post by:
Using ASP.net 1.1 and Microsoft Access. I received the following error message. Why? I have closed the Access file. I have another very small access file that opens with no trouble with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...

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.