http://www.mkyong.com/computer-tips/cant-create-file-in-the-c-drive-root-directory-windows-8/
Developing a simple Java program to write a file with the C drive root directory (where Windows is installed), but the Progr Am prompts an "access is denied" error. Try to create a empty file in the C drive root directory manually, but no options to create any files, only new folder is Allowed.
P.S the logged in user is under Administrator group.
Solution
In Windows 7 or 8 (could be Vista), users (even administrators) is not allowed to create files in the C drive root director Y, otherwise, an error message like 'A required Privilegeis not held by the client ' or 'access is DENIED "would be prompted."
To fix it, just turn off the User account Control (UAC). In Windows 8, does not turn off the UAC via Control Panel, it must go through the registry.
- Press keys "Windows Key + R", type
regedit
- Locate
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
- Update the
EnableLUA
value to 0 (turn if off)
- Restart Windows.
Alternatively
If you think it's not safe to turn off the UAC feature, then create a new folder under the C drive root directory and put The file inside.
C:\folder\your-file.txt-OK
C:\your-file.txt-NOT OK
Fw:can ' t Create File in the C drive Root directory–windows 8