administrator account still cannot write to c:\program files\

リ カイエイ 20 Reputation points
2023-07-20T06:01:35.5066667+00:00

hi,

I have an install script that needs to write to C:\program files\ as well as the registry. But on some win10, this work cannot be done, even if I log in with an administrator account. The "Behavior of the elevation prompt for administrators in Admin Approval Mode" has been disabled in User Account Control, and the UAC control has been changed to "Never notify". However, when viewed in the properties of C:\program files, the administrator still does not have full control rights, and all options are grayed out and cannot be changed. Whether I log in with a domain administrator account or a member of the local administrators group, the result is the same inaccessibility.

So,I have several questions like this:

  1. Some win10 computers cannot write to C:\program files, and cannot change its access rights, while others can write. What are the reasons for the different results?
  2. Normally, how to install and configure different application parameters according to the user environment? Can msi be installed silently and carry different installation parameters?
  3. During the running of the program (ordinary user login), if the configuration needs to be changed according to the dynamic changes of the environment, can the configuration file be placed in the subfolder of C:\program files, and how to ensure writable access rights?

Using a domain administrator account, or a member of the local administrator user group, still cannot write to the c:\program files folder

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,196 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 44,126 Reputation points
    2023-07-20T14:11:56+00:00

    Hello

    Thank you for your question and reaching out.

    C:\Program files folder is protected folder even for Administrator account .

    You need to take Ownership to Write this folder or you can use SYSTEM account.

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. リ カイエイ 20 Reputation points
    2023-07-24T06:57:17.03+00:00

    In fact, this is the reason. This script is used to install the software package. The reason why the script is used instead of msi is because it needs to carry parameters. Later, it was found that it is also feasible to carry parameters and install silently. But encountered a new problem, how does the AD administrator deploy silent installation and carry parameters? GPO policies can specify .msi packages, but there is no option to carry parameters. Scripts such as startup and logon can specify scripts, but how to upgrade to administrator privileges? Is it possible without elevating privileges? I did not configure successfully, please solve, thank you.

    windows server is 2022,user is win10.

    0 comments No comments