samedi 28 février 2015

system function on windows 7 failed with access denied error

I am writing a simple c++ app in visual studio 2012 on windows 7 wherein I am using the system command, strangely the system command fails with access denied error. For ex, I am trying to create a directory using system("mkdir C:\abc"), the command fails and the errno is set to EACCESS. Though I fail to create a new directory programmatically, I can very well create a new directory through the command prompt or through explorer. Also, the CreateDirectory Windows API works fine, it is the system function that is the issue - because no matter what command I pass to the system function, it fails with the same error EACCESS.


I have also noticed that this is machine specific, running the same program on a different machine is no issue.


Any ideas what could be going wrong on this unfortunate machine.


Things that I have already tried 1) Setting administrator privileges on the application 2) ran the system file checker - no problem detected 3) disable avast


Any help would be great. Thanks.


Aucun commentaire:

Enregistrer un commentaire