Private voidButton1_Click (Objectsender, EventArgs e) { varPath=Environment.getfolderpath (Environment.SpecialFolder.CommonApplicationData); MessageBox.Show ("Path:"+path); vardir = path +"\\edutools\\"; if(!directory.exists (dir)) {directory.createdirectory (dir); } Process.Start ("Explorer.exe", dir); } Private voidButton2_Click (Objectsender, EventArgs e) { varPath =Environment.getfolderpath (Environment.SpecialFolder.ProgramFiles); MessageBox.Show ("Path:"+path); vardir = path +"\\edutools\\"; if(!directory.exists (dir)) {directory.createdirectory (dir); } Process.Start ("Explorer.exe", dir); } Private voidButton3_Click (Objectsender, EventArgs e) { varPath =Environment.getfolderpath (Environment.SpecialFolder.UserProfile); MessageBox.Show ("Path:"+path); vardir = path +"\\edutools\\"; if(!directory.exists (dir)) {directory.createdirectory (dir); } Process.Start ("Explorer.exe", dir); } Private voidButton4_Click (Objectsender, EventArgs e) { varPath =Environment.getfolderpath (Environment.SpecialFolder.System); MessageBox.Show ("Path:"+path); vardir = path +"\\edutools\\"; if(!directory.exists (dir)) {directory.createdirectory (dir); } Process.Start ("Explorer.exe", dir); } Private voidButton5_click (Objectsender, EventArgs e) { varPath =Environment.getfolderpath (Environment.SpecialFolder.ApplicationData); MessageBox.Show ("Path:"+path); vardir = path +"\\edutools\\"; if(!directory.exists (dir)) {directory.createdirectory (dir); } Process.Start ("Explorer.exe", dir); } Private voidButton6_click (Objectsender, EventArgs e) { varPath =Environment.getfolderpath (Environment.SpecialFolder.Windows); MessageBox.Show ("Path:"+path); vardir = path +"\\edutools\\"; if(!directory.exists (dir)) {directory.createdirectory (dir); } Process.Start ("Explorer.exe", dir); }
Test results:
On the Win7 32-bit without granting administrator permission (no tick indicates that a success could not be created):
Environment.SpecialFolder.CommonApplicationData