码迷,mamicode.com
首页 > Windows程序 > 详细

FW: Can’t Create File In The C Drive Root Directory – Windows 8

时间:2015-01-05 12:53:30      阅读:304      评论:0      收藏:0      [点我收藏+]

标签:

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 in the C drive root directory (where Windows is installed), but the program prompts an “access is denied” error. Try to create an 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 (may be Vista), users (even administrators) are not allowed to create files in the C drive root directory, otherwise, an error message like “A required privilege is not held by the client” or “access is denied” will be prompted.

To fix it, just turn off the User Account Control (UAC). In Windows 8, do not turn off the UAC via control panel, it must go through the registry.

  1. Press keys “Windows Key + R”, type regedit
  2. Locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
  3. Update the EnableLUA value to 0 (turn if off)
  4. 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

标签:

原文地址:http://www.cnblogs.com/xixifusigao/p/4203219.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!