Can a program write to the root directory of a disk when UAC is turned on without having admin privileges?

后端 未结 3 412
死守一世寂寞
死守一世寂寞 2021-01-29 00:17

If I am not an Administrator and start a program which writes to C:\\ some textfile - will I need admin rights...in Windows 7 or Vista? I see in XP there are no problems to writ

3条回答
  •  迷失自我
    2021-01-29 00:38

    That depends on whether C:\ is a filesystem that supports permissions, and if so on the permissions set on the root directory, which can be modified by users with the correct privileges. Use GetTempPath() for temporary files, or SHGetFolderPath passing e.g. CSIDL_APPDATA

提交回复
热议问题