"Unable to create directory" error with "Access to path is denied." when building a solution in Visual Studio

14,606

Solution 1

I would not change it. The problem is not that Program Files is read only, the problem is that you cannot write to it with user level permissions.

The best way to solve this is to change your output to a different location, like under your C:\Users\<yourname> where you will have permissions.

If you really want to to do it in Program Files anyway, you can run Visual Studio as an administrator. But I still recommend changing your output folder over doing that.

Solution 2

Even if this post is rather old: The linker tab in the project properties holds an output file variable which by default is something like "$(CommonProgramFiles)\VST3\Steinberg\$(ProjectName)$(TargetExt)". Change that to a path you / VS has writing rights to and things should work again.

Regards, G.

Share:
14,606

Related videos on Youtube

tomi.lee.jones
Author by

tomi.lee.jones

Updated on June 04, 2022

Comments

  • tomi.lee.jones
    tomi.lee.jones almost 2 years

    I'm trying to build a VS2010 C++ project in VS2013 (to be precise, an example project from Steinberg Vst SDK) and get the following error:

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(1235,5): error MSB3191: Unable to create directory "C:\Program Files (x86)\Common Files\VST3\Steinberg". Access to the path 'C:\Program Files (x86)\Common Files\VST3\Steinberg' is denied.

    I haven't modified anything. I've tried to find an answer but the ones i found either are very vague, or doesn't apply to C++. From the error it's clear the problem is that i can't output to Program Files since it's read-only , so how do i change the output directory?

    EDIT: I've modified the "Output directory" field in project's properties -> configuration properties -> general tab. However, the error stays the same.

    EDIT2: SOLVED the problem. The linker output was set to Program Files.

    Thanks in advance for answers.

  • tomi.lee.jones
    tomi.lee.jones over 9 years
    That is exactly my question: how do i change the output to a different location?
  • ElGavilan
    ElGavilan over 9 years
    Right click on your project and open "properties", under the Compile tab you should be able to change it.
  • tomi.lee.jones
    tomi.lee.jones over 9 years
    There is only a "General" tab with a "Output directory" field. I've changed that and the error stayed the same.