D
Dick Swager
I am creating a virtual drive with the subst command at the command prompt
as follows:
subst W: C:\WRoot
Now if I view the directory structure in the Windows Explorer I see that I
have the W: drive available to me
Then I create a file at W:\Test\Test.txt.
But now if I try to access the W: from the OpenFileDialog I do not have the
W: directory available. This was working fine with XP but since I moved to
Vista I have lost the capabilty. How can I get this to work with Vista?
To test I created a C# windows project, added a Button and a TextBox, and
created the button press event handler with the following code
private void button1_Click (object sender, EventArgs e)
{
// Launch a dialog to set or retrieve a file name.
OpenFileDialog dialog = new OpenFileDialog ();
dialog.InitialDirectory = "W:\\";
dialog.RestoreDirectory = true;
dialog.Multiselect = false;
dialog.CheckFileExists = false;
DialogResult result = dialog.ShowDialog ();
if (result != DialogResult.OK)
return;
string fileName = dialog.FileName;
textBox1.Text = fileName;
}
Thanks,
Dick
as follows:
subst W: C:\WRoot
Now if I view the directory structure in the Windows Explorer I see that I
have the W: drive available to me
Then I create a file at W:\Test\Test.txt.
But now if I try to access the W: from the OpenFileDialog I do not have the
W: directory available. This was working fine with XP but since I moved to
Vista I have lost the capabilty. How can I get this to work with Vista?
To test I created a C# windows project, added a Button and a TextBox, and
created the button press event handler with the following code
private void button1_Click (object sender, EventArgs e)
{
// Launch a dialog to set or retrieve a file name.
OpenFileDialog dialog = new OpenFileDialog ();
dialog.InitialDirectory = "W:\\";
dialog.RestoreDirectory = true;
dialog.Multiselect = false;
dialog.CheckFileExists = false;
DialogResult result = dialog.ShowDialog ();
if (result != DialogResult.OK)
return;
string fileName = dialog.FileName;
textBox1.Text = fileName;
}
Thanks,
Dick