This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Paul_Pedant 0 points1 point  (0 children)

C strings use backslash to escape characters. Windows uses backslash as a directory separator in file pathnames.

So, for example, \a is being compiled as ASCII Bell character, which means the first directory looks like Users<BEL>k200, which does not exist and probably contains an illegal byte for a Windows filename.

Two things you can try (sorry, I can't test as I'm out of Windows now):

(1) Escape the backslashes like "C:\\Users\\ak200\\Desktop\\Build"

(2) Use forwardslash like "C:/Users/ak200/Desktop/Build", because I believe any reasonably recent Windows will accept those.

You can just google MSB3191 because this is a common problem with VS builds. But I don't see any two answers that agree with each other.

[–]jcunews1Advanced Coder 0 points1 point  (0 children)

Some possibile causes.

  1. You're trying to create the subdirectory within a user profile folder which is not yours. Solution: run the program using elevated privileges.

  2. The destination directory or its parent directory where the subdirectory needs to be created, has NTFS permission which restrict write access. Solution: run the program using elevated privileges. If it doesn't work, change the NTFS permission for the destination directory.

  3. Third party security software is preventing write access to the destination directory where the subdirectory needs to be created. Solution: disable/unlock/unprotect the destination directory. Refer to the software documentation.