gpt4 book ai didi

c# - Windows自动激活方法

转载 作者:可可西里 更新时间:2023-11-01 11:48:29 26 4
gpt4 key购买 nike

我需要一个 Windows 激活方法。我的代码有效,但它创建了一个弹出窗口,我不想要它。
有什么方法可以在后台激活而不显示任何消息吗?

private void tryingActivateWindows()
{
ProcessStartInfo psi = new ProcessStartInfo("cmd", "/c " + "SLMGR -ato");
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
Process p = new Process();
p.StartInfo = psi;
p.Start();
p.WaitForExit();
}

最佳答案

private void tryingActivateWindows()
{
Process activateScript = new Process();
activateScript.StartInfo.FileName = @"cscript";
activateScript.StartInfo.WorkingDirectory = @"C:\Windows\System32\";
activateScript.StartInfo.Arguments = "//B //Nologo slmgr.vbs -ato";
activateScript.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
activateScript.Start();
activateScript.WaitForExit();
}

关于c# - Windows自动激活方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37203224/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com