visual c++ – Unable to create a Directory in th mapped drive – Education Career Blog

I am unable to create a directory in a mapped drive. e.g. i have mapped U: to some location which there in the network. Using vc++ i am using CreateDirectory api, but it’s not able to create directories. If i am giving any local machine location, it’s creating. any solutions. Please let me know.

I have tried debugging my application, i find out that while running window service it’s not creating but through debugging it’s creating.

NOTE:
the location i want to create directory have full permissions.

,

It looks like the drive mapping to U: is not visible from your service. That’s expected, since drive mappings are usually established per-user or per-session.

However, CreateDirectory() supports UNC paths, so you can pass \\server\share\path directly instead of using a mapped drive.

Leave a Comment