在安装Microsoft Visual C++ 2008 Redistributable package时出现了身份验证问题。

huangapple go评论86阅读模式
英文:

Authentication Issue while installing Microsoft Visual c++ 2008 Redistributable package

问题

当我尝试通过golang静默安装Microsoft Redistributable包时,我遇到了以下错误:

> fork/exec C:\Windows2008R2.exe: The requested operation requires elevation.

我的代码如下:

package main

import (
	"fmt"
	"os/exec"
)

func main() {
	co := exec.Command("C:\\Windows2008R2.exe","/q","/c:\msiexec","/i","Windows2008R2.msi","/qn","/l*v","C:\\Windows2008R2_x64.log")
    if err := co.Run(); err != nil { 
        fmt.Println("Error: ", err)
    }  
}
英文:

When i try to install Microsoft Redistributable package silently through golang i get this error

**

> fork/exec C:\Windows2008R2.exe: The requested operation requires
> elevation.

**

And my code is as follows

package main

import (
	"fmt"
	"os/exec"
)

func main() {
	co := exec.Command("C:\\Windows2008R2.exe","/q","/c:\"msiexec","/i","Windows2008R2.msi","/qn","/l*v","C:\\Windows2008R2_x64.log\"")
    if err := co.Run(); err != nil { 
        fmt.Println("Error: ", err)
    }  
}

答案1

得分: 1

似乎你不是该文件的所有者。
要更改文件的所有权,你可以...

  1. 进入包含需要拥有所有权的文件的文件夹的属性
  2. 点击安全选项卡
  3. 点击高级选项
  4. 点击所有者选项卡
  5. 点击编辑...
  6. 在“更改所有者为”列表中选择你想要拥有所有权的账户名
  7. 勾选“替换子容器和对象上的所有者”复选框
  8. 点击确定
英文:

Seems like you are not the owner of the file.
In order to change the ownership of the files you can...

  1. go in to the properties of the folder that contains the files you need to take ownership of
  2. click on the security tab
  3. click Advanced
  4. click on the Owner tab
  5. Click Edit...
  6. Select the account name in the Change owner to list that you want to take ownership
  7. Check the box, Replace owner on subcontainers and objects
  8. Click OK

huangapple
  • 本文由 发表于 2015年11月17日 18:54:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/33755113.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定