|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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.GetExecutingAssembly.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? 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) Show quoteHide quote "James Maeding" <jmaed***@nettaxi.com> schreef in bericht news:kqg8p2h6gb9bnu3c8779i1h2v4v3q6hvi0@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.GetExecutingAssembly.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?
working with Access in VB.Net
When to use AndAlso vs And ? Trying to get started with tables... Binary Search Tree - CompareTo Error Waiting for a process to halt before continuing How do I handle a NULL XmlElement? Get spawned process how to check if the dataset is EOF or if a record exists frist . GotFocus versus PreviewKeyDown or Other Change Connection String during runtime |
|||||||||||||||||||||||