473,796 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.GetDirecto ryName(System.R eflection.Assem bly.GetExecutin gAssembly.Locat ion()) & "\"
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 1580
JR
the next code from 2003 works fine for me

Dim strAppPath As String = Application.Sta rtupPath

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

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

"James Maeding" <jm******@netta xi.comschreef in bericht
news:kq******** *************** *********@4ax.c om...
>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.GetDirecto ryName(System.R eflection.Assem bly.GetExecutin gAssembly.Locat ion())
& "\"
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
498
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 to find Microsoft Internet Explorer. I don't know where I would need to start to resolve this. I am running the entire environment on a server machine and have looked at solutions to failure of debugging aspx pages, but none seem to be...
5
2624
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 runs the same C# console app as a CGI immediately. The C# app and Delphi application both send the same, minimal, output back to the webserver. Both applications start as normal, and quickly, from Explorer.
2
1936
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 following (Where "MyProgram.exe" is my new VB,net creation) When the user runs Setup.exe, he is presented with the choice of installing to \Program Files\MyProgram or a location of his choosing. Setup copies all the files to that location,...
9
2430
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 doe", with a space in it). For console input, cin.getline(var, howMuchIWant) or cin.get() has done the trick for me in the past. It doesn't seem to work for me nearly so well with a file stream. I wouldn't have thought cpp regarded
6
6491
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 can see it in my task manager, but it is not visible. Can anyone explain what is happening? My code: Process p = Process.Start("IExplore.exe", m_strURL);
4
11109
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. I know I'm supposed to have a "Default.aspx", but I wanted to rename it to something else. Is it possible to change the name its looking for in the dev server? Or is that only available in the full blow IIS?
8
1700
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, giving it the starting method of the class? b. Have the class create the thread itself? ie: x = new WorkerClass(); ioThread = new Thread(new ThreadStart(x.StartWork));
5
2351
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 fine but passes an error that the file(s) are in use ny another user. This other user must be the windows explorer. Any workarounds to free the files from the windows explorer?
2
3157
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 message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation aborted". It is working in Mozilla . Here i mentioned my code . I am facing this problem several...
0
9535
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
10465
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...
1
10200
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
10021
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
9061
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...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6800
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
5453
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.