Search code examples
vb.netsecuritywindows-7permissionscreate-directory

How can i create a directory in drive C:\?


i am trying to create a directory in drive C: (at a win7 target machine) with Directory.CreateDirectory but so far no luck.

I believe the problem has to do something with permissions-security... So here i am..

How can i create a directory in drive C?


Solution

  • You should not use the root of C for an ordinary application. If you're just using it because you think it's a folder you can count on, use AppData or Temp instead. If this is not an ordinary application, but is instead an administrative application, then put a manifest on it requesting it elevate (requireAdministrator) so that it can gain access to the areas of the hard drive and registry protected by UAC.