如何避免每次在 Windows 机器上都以管理员身份运行

如何避免每次在 Windows 机器上都以管理员身份运行

为了编辑 c: 中的 JSP 文件,我Run as Administrator每次都必须运行记事本和命令提示符。我使用的是 Windows 7,系统中只有一个用户。我不能以管理员身份登录系统吗?

答案1

也许,这会有所帮助:

To mark an application to always run as an administrator, do the following:

1. On the Start menu, locate the program that you want to always run as an administrator.
2. Right-click the application’s shortcut, and then click Properties.
3. In the Properties dialog box, click the Compatibility tab.
4. Do one of the following:

    To apply the setting to the currently logged-on user, 
        select the Run This Program As An Administrator check box, and then click OK.
    To apply the setting to all users on the computer and 
        regardless of which shortcut is used to start the application, 
        click Change Setting For All Users to display the Properties dialog box for the application’s .exe file, 
        select the Run This Program As An Administrator check box, and then click OK twice.

更新

您必须先打开C:\windows\explorer.exeAdministrator然后浏览到此位置:C:\Windows\System32\。然后右键单击并更改属性。对位置“C:\WINDOWS\system32\”Notepad.exe执行相同操作。command prompt

答案2

听起来您把 .jsp 文件放在了标准用户帐户默认没有写入权限的位置。这包括 C: 驱动器的根目录...标准用户帐户不再具有对根 C:\ 文件夹的写入权限。自 Windows 2000 和 Windows XP 以来,情况一直如此。

从那时起,人们就一直逍遥法外,因为许多人一直以管理员帐户运行,因此无论如何都能将文件写入 C:\ 文件夹。从 Windows Vista 开始,默认情况下您不再拥有管理员权限……即使以管理员帐户登录也是如此。相反,要使用管理员权限,您必须使用上下文菜单上的“以管理员身份运行”选项。

要解决文件编辑问题,您可以更改 *.jsp 文件所在的特定文件夹的安全权限,以允许您的特定用户帐户对该文件夹具有写访问权限。您可能不应该对整个 C: 驱动器执行此操作。相反,将 jsp 文件移动到您可以使用的文件夹中。

答案3

您应该能够以管理员身份登录并关闭 UAC,以管理员身份运行所有内容。

http://windows.microsoft.com/en-GB/windows-vista/Turn-User-Account-Control-on-or-off

答案4

您面临的问题是 NTFS 安全性。

作为普通用户,您的权限不允许您在驱动器的根目录下创建文件,因此您始终需要管理员权限才能执行此操作。

要禁用此类行为,您需要在要更新安全令牌的驱动器上打开带有高级选项的安全属性对话框:

在此处输入图片描述

之后相应地更新权限以允许对 C 盘根目录的完全访问:

在此处输入图片描述

启用所需的权限,确保应用它仅有的到根驱动器文件夹(否则普通用户可以访问/修改重要的 Windows 文件)

在此处输入图片描述

好的,申请后你就可以开始摇滚了。

如果您仍然需要管理员访问权限,则需要将进程的完整性级别设置为中或低,当文件具有高完整性级别时,只有管理员才能访问和修改文件。

要更改完整性级别,请使用文件上的 ICACLS 工具(包含在 Windows 中)。确保从提升的命令提示符执行该工具。

在此处输入图片描述

相关内容