[Solution] Need Administrator Privileges Despite Being an Administrator? Unable to Run as Administrator? Troubleshooting Method | おれんじあんてな

[Solution] Need Administrator Privileges Despite Being an Administrator? Unable to Run as Administrator? Troubleshooting Method

me.png
This article is a translation of content originally crafted in Japanese. The images featured within the article are in Japanese.

When attempting to run a program in a Windows 10 environment, you may encounter a message stating "Run with administrator privileges", even if you already have administrator rights. This message can prevent the process from continuing.

In my case, I faced this issue when trying to install "Node.js," and despite various attempts, I couldn't proceed with the installation.

After researching and trying different methods without success, I found a workaround that worked for me.

This article covers the steps to check permissions when prompted for administrator privileges and provides solutions if the issue persists.

Checking Permissions and Granting Administrator Rights

Since the message suggests running with administrator privileges, it's essential to verify the current user's permissions.

If, upon checking, the logged-in user does not have administrator rights, granting them might resolve the issue. In my case, the permissions were already granted, but it's good practice to double-check.

The steps for adjusting permissions may vary depending on the edition of Windows 10. Let's outline the process for Windows 10 Pro or Enterprise.

For Windows 10 Pro or Enterprise

If your edition is Windows 10 Pro or Enterprise, you can check and grant permissions for the logged-in user through the [Administrative Tools].

Even if you have another edition and [System Tools] - [Local Users and Groups] is available from [Administrative Tools], it is recommended to perform operations from [Administrative Tools].

Confirmation of Administrator Privileges
  1. Select [Windows System Tools] - [Windows Administrative Tools] from the Start menu.
  2. Launch [Computer Management] under [Administrative Tools].
  3. Expand [System Tools] - [Local Users and Groups] - [Users].
  4. Double-click the user name of the logged-in user to open properties.
  5. Expand the [Member Of] tab.
  6. Ensure that [Administrators] is listed under [Member Of].
Select [Windows Administrative Tools] from the Start menu

Select [Windows Administrative Tools] from the Start menu

Launch [Computer Management]

Launch [Computer Management]

[Local Users and Groups] - [Users]

[Local Users and Groups] - [Users]

Confirm [Administrators]

Confirm [Administrators]

If [Administrators] is not listed under [Member Of], you don't have administrator privileges. Follow the steps below to add permissions.

Granting Administrator Privileges
  1. Press the [Add] button on the [Member Of] tab.
  2. In the expanded [Select Groups] dialog, press the [Advanced Settings] button.
  3. In the expanded dialog, press the [Search] button.
  4. Select [Administrators] from the search results and press [OK], closing all dialogs along the way.
Press the [Add] button

Press the [Add] button

Press the [Advanced Settings] button

Press the [Advanced Settings] button

Press the [Search] button

Press the [Search] button

Select [Administrators] and press [OK]

Select [Administrators] and press [OK]

For Windows 10 Home

If your edition is Windows 10 Home, you will need to check and configure user information through [Control Panel] as [System Tools] - [Local Users and Groups] is not available in [Administrative Tools].

Confirmation of Administrator Privileges
  1. Select [Windows System Tools] - [Control Panel] from the Start menu.
  2. Choose [Change Account Type] under the [User Accounts] category.
  3. In the list of user accounts, confirm that the logged-in user is [Administrator].
Select [Control Panel] from the Start menu

Select [Control Panel] from the Start menu

Choose [Change Account Type]

Choose [Change Account Type]

Confirm [Administrator]

Confirm [Administrator]

If the logged-in user is not [Administrator], follow these steps to change permissions.

Changing to Administrator Privileges
  1. Click on the user name of the logged-in user in the list of user accounts to navigate to the settings screen.
  2. Choose [Change Account Type].
  3. Select [Administrator] from the radio buttons and press [Change Account Type].
Choose [Change Account Type]

Choose [Change Account Type]

Select [Administrator]

Select [Administrator]

Regarding the radio buttons on the [Change Account Type] screen, please note that immediately after transitioning to the screen, the selected state is not the current permission setting.

Make sure not to misunderstand that the currently set permission is selected. If the radio button for the current permissions is selected, the [Change Account Type] button will be disabled, indicating that administrative privileges are already set.

Running Programs as an Administrator

When you right-click on an installer (msi file) or an executable file (exe file), and you see the option "Run as administrator," you can launch it with administrative privileges, allowing for smooth execution.

[Run as administrator] menu

[Run as administrator] menu

If this option is not available, you can configure the program to run as an administrator from the Properties.

Setting to Run the Program as an Administrator
  1. Right-click on the target file.
  2. Select [Properties] from the context menu that appears.
  3. Choose the [Compatibility] tab in the Properties dialog.
  4. Check the box for [Run this program as an administrator] under [Settings].
  5. Press [OK] to close the Properties dialog.
[Properties] menu

[Properties] menu

[Run this program as an administrator] checkbox

[Run this program as an administrator] checkbox

When you launch the program from an icon with the administrator settings, it will run with administrative privileges, allowing for trouble-free program execution or installation.

In my trial, the [Run this program as an administrator] checkbox was grayed out, and I couldn't check it. In some cases, creating a shortcut for the executable file and setting [Run as administrator] in the shortcut icon's properties may work, but unfortunately, it didn't in this instance.

What to Do When "[Run as administrator]" Is Unavailable

If the standard methods so far don't resolve the issue, it can be quite frustrating. I faced a similar situation, but I found a solution through a simple workaround.

The method involves running the file from the command prompt opened with administrator privileges.

Method to Run as Administrator
  1. Expand [Windows System Tools] from the Windows Start menu.
  2. Right-click on [Command Prompt].
  3. Select [More] - [Run as administrator] from the context menu.
  4. Hold down the Shift key while right-clicking on the icon of the file you want to run with administrative privileges.
  5. Select [Copy as path] from the context menu.
  6. Right-click in the command prompt running as an administrator and paste the path.
  7. Press Enter.
  8. The program will launch with administrator privileges.
Expand [Windows System Tools] from the Start menu

Expand [Windows System Tools] from the Start menu

Right-click on [Command Prompt] and select [Run as administrator]

Right-click on [Command Prompt] and select [Run as administrator]

Shift key + Right-click to [Copy as path]

Shift key + Right-click to [Copy as path]

Paste the path and run

Paste the path and run

By launching from the command prompt with administrator privileges, the executed program or installer also runs with administrative privileges. This workaround successfully avoids the issue of being asked for administrator privileges when you are already an administrator.

Creating a Batch File to Run with Administrator Privileges

If you only need to run a file once, manually starting the Command Prompt as an administrator and executing the file might be sufficient. However, for programs you use frequently, creating a batch file to run the file from the administrator Command Prompt is recommended.

When creating a batch file, open a text editor and copy & paste the source code provided below.

Please note that when creating the batch file, the line breaks should be "CRLF," and the character encoding should be "SJIS" to handle two-byte characters in file names properly.

The flow of the batch file's operation is explained in the comments within the source code.

For Fixed Executable Files

If you have a specific file you want to run as an administrator, it's convenient to specify the file directly within the source code so that you can double-click to run it.

@echo off

rem Set the path of the file you want to run as an administrator
set file_path="C:UsersPublicDesktophogehoge.exe"

rem Output a batch file to launch the file from the set path
echo %file_path% > start_up.bat

rem Run the batch file for starting the program with administrative privileges
powershell start-process start_up.bat -verb runas -WindowStyle Minimized

rem Delete the output batch file
del start_up.bat

exit

Change the part on the fourth line, `"C:UsersPublicDesktophogehoge.exe"`, to the path of the file you want to run. Save the file with the extension ".bat" and double-clicking it will prompt you to run the file as an administrator. This method is useful for launching a specified file without much hassle.

For General Use Batch File

If you don't have a specific file in mind and want a more versatile solution, you can create a batch file that allows you to drag and drop files onto it to run them as administrator. Below is the source code for such a batch file.

@echo off

rem Loop through the number of files dropped in the batch file
for %%f in (%*) do (

rem Output a batch file to launch the file from the obtained path
echo %%f > start_up.bat

rem Run the batch file for starting the program with administrative privileges
powershell start-process start_up.bat -verb runas -WindowStyle Minimized

rem Delete the output batch file
del start_up.bat

)

exit

This batch file can be a generic solution for running files with administrator privileges. When you drag and drop files onto this batch file's icon, it will prompt you to run the files as an administrator. While it's a bit more involved than double-clicking, it offers a versatile solution without specifying file names in the source code.

Conclusion

If you have already launched the Command Prompt as an administrator, any programs executed from there will inherit the administrator privileges. Although the exact cause of being prompted for administrator privileges when your user account is already in the [Administrators] group is unclear, this workaround effectively avoids the issue.