1.

Solve : How can I for directory access.?

Answer»

I need to check if I have access to a directory. I'm doing this now, by trying to create a file in that directory and then I'm checking if it exists. In Visual Studio post build event that returns an error if I have no access. I don't KNOW how to get rid of that error.To check access to a directory, why not just try to open the directory?What do you mean? I can navigate to the directory. I just can not create objects there. So my check has to figure out if I'm allowed to create folders there.It seems odd that you can access it and yet not create files. If access was denied, you'd get a message saying "Access is denied" when you TRIED to open the folder.

Are you the ADMINISTRATOR of your computer?What do you mean? On Windows you can view a folder the files in the folder, but you may not be able to let's say create a file in that folder.

I'm an Admin on my machine.I'm not entirely sure what you're trying to do here but /a:x and /d switches of the dir command used in conjunction with each other may prove USEFUL. It can be used to return all the directories in a location with chosen attributes set and redirect those results to a file or device.
The /a:-x switch will return directories with the chosen unset attributes.

The "x" above refers to the following qualifiers:

D Directory bit
R Read-only bit
H HIDDEN bit
A Archive bit
S System bit



Discussion

No Comment Found