473,387 Members | 1,942 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,387 software developers and data experts.

how to start explorer to console app location?

I am using VS 2005 to make a console app that shuts down explorer.exe and restarts it.
I can shut it down no problem, its starting it back up to the same folder as the console app that is proving difficult.
This code works fine in debug run but fails on final release:

Dim strAppPath As String = Path.GetDirectoryName(System.Reflection.Assembly.G etExecutingAssembly.Location()) & "\"
Process.Start("Explorer.exe", "/e, " & strAppPath)

also tried
Process.Start("Explorer.exe", Chr(34) & "/e, " & Chr(34) & " " & Chr(34) & strAppPath & Chr(34))
in case the quotes were the issue, no luck.

I can have it write the path to the console window and it shows fine, explorer seems to be rejecting it, any ideas?
Dec 28 '06 #1
1 1566
JR
the next code from 2003 works fine for me

Dim strAppPath As String = Application.StartupPath

strAppPath &= IIf(strAppPath.EndsWith("\"), "\", "")

Process.Start("Explorer.exe", "/e, " & strAppPath)

"James Maeding" <jm******@nettaxi.comschreef in bericht
news:kq********************************@4ax.com...
>I am using VS 2005 to make a console app that shuts down explorer.exe and
restarts it.
I can shut it down no problem, its starting it back up to the same folder
as the console app that is proving difficult.
This code works fine in debug run but fails on final release:

Dim strAppPath As String =
Path.GetDirectoryName(System.Reflection.Assembly.G etExecutingAssembly.Location())
& "\"
Process.Start("Explorer.exe", "/e, " & strAppPath)

also tried
Process.Start("Explorer.exe", Chr(34) & "/e, " & Chr(34) & " " & Chr(34) &
strAppPath & Chr(34))
in case the quotes were the issue, no luck.

I can have it write the path to the console window and it shows fine,
explorer seems to be rejecting it, any ideas?

Dec 31 '06 #2

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

Similar topics

0
by: J. Hazell | last post by:
I am attempting to start debugging an aspx page. IE is installed in the default location. Whenever I start the debugging process it fails with the error message. Cannot start debugging. Unable...
5
by: The Last Danish Pastry | last post by:
Why might IIS 5.1 take a long time (8 seconds) to start a C# console application as a CGI process, but run a Delphi console app that does the same thing in no time at all? Apache2 starts and...
2
by: | last post by:
I am new to Visual Basic.Net using the Standard Edition, which does not come with a Deployment wizard, so I use the template on the File Systems Tab. Everything works fine, and I have enabled the...
9
by: sherifffruitfly | last post by:
Hi, I've a got a little (exercise) program that reads data from a file and puts it into struct members. I run into trouble when one of the data pieces is comprised of several words (eg "john...
6
by: uuyytt | last post by:
I have a Windows service from which I want to start Internet Explorer with a particular URL as an argument. I don't know why my code (shown below) doesn't work. I know that IExplore.exe starts as I...
4
by: Nobody | last post by:
Hi, I'm using ASP.NET w/ Visual Studio 2005 and the .net development server... how do I set the default start up page? right now when I go to http://localhost/WebSite I get a directory listing....
8
by: Carl Heller | last post by:
If I'm creating a class to do some work that I want threaded out, where's the best location to call ThreadStart? Or does it depend on the nature of the work? a. Call it outside the class,...
5
by: =?Utf-8?B?SmFwZQ==?= | last post by:
im writing a c# console application that copies files chosen from the windows explorer. I chose the files i want to copy and then from the (right key) menu chose my program. the program starts...
2
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.