Edit: Using “Documents” instead of “My Documents” gets rid of the error. I was also recommended to use the Windows special folders instead of absolute paths.
I’m attempting to replace all the shortcuts on my desktop with an application I’m writing that will have its own version of the shortcuts. I plan to give the new shortcuts some of the same functionality as the old ones. Before doing anything else, I figured opening the file or folder that the shortcut points to would be important. Here’s a sample piece of code:
public partial class Form1 : Form
{
Process p1, p2, p3, p4;
public Form1()
{
InitializeComponent();
p1 = new Process();
p2 = new Process();
p3 = new Process();
p4 = new Process();
p1.StartInfo.FileName = "cmd";
p2.StartInfo.FileName = "c:\\Users\\Cheese\\My Documents";
p3.StartInfo.FileName = "c:\\Users\\Cheese\\AppData";
p4.StartInfo.FileName = "c:\\Program Files (x86)";
}
private void button1_Click(object sender, EventArgs e)
{
p1.Start();
}
private void button2_Click(object sender, EventArgs e)
{
p2.Start();
}
private void button3_Click(object sender, EventArgs e)
{
p3.Start();
}
private void button4_Click(object sender, EventArgs e)
{
p4.Start();
}
}

This is on Windows 7 Home Premium. I’m getting the error while debugging in Visual C# 2010 Express. I’ve opened several other folders like System32, AppData, and various folders on another partition on the same drive. I was able to open various music files and run different programs. Everything seems to work fine except for My Documents. I would think that the Windows folder would have greater restrictions than the default location for personal files. I’m thinking it’s not really a permissions thing, but I can’t even guess what might be the issue. I can open My Documents with explorer. I can move files to and from the directory.
This seems like such a simple thing. I know that there’s a lot I don’t fully understand about how Windows works, but this situation and a few others are making me think that maybe I don’t really know much of anything about Windows. What are some good books or web resources that I can look into to get a good grasp of this operating system? Possibly with a focus on file management and system privileges from a novice’s point of view?
As commented,
Under Windows 7 “My Documents” is a Junction link to “Documents”, trying to launch the process on a junction will fail with this error. Launch “c:\Users\Cheese\Documents” instead.
Or if this the current users my documents folder you should really ask the system for its path.