首页 热点资讯 义务教育 高等教育 出国留学 考研考公

使用VCdControlTool提示Cannot Open Scm

发布网友 发布时间:2022-04-22 16:22

我来回答

5个回答

热心网友 时间:2023-10-06 13:08

如果你是win7系统的话,在VCdControlTool.exe单击右键,选择属性,在兼容性一栏中选择“以管理员身份运行此程序”确定即可。

热心网友 时间:2023-10-06 13:09

我也是在运行微软虚拟光驱点击"驱动器控制"的时候提示Cannot Open Scm拒绝访问,点击确定后再点击"安装驱动器”,又提示句柄无效,不知道怎么使用了。

热心网友 时间:2023-10-06 13:09

我也是遇到同样的问题,急需解决

热心网友 时间:2023-10-06 13:10

Hi,

Is it acceptable for you to use impersonation in your code? I did a test and found that we can get services list of a remote machine by impersonation.

CodeFx provides a demo about how to impersonate a user, you will find the demo in CSImpersonateUser solution, and in its Main method, use following code snippet:

class Program

{

static void Main(string[] args)

{

/////////////////////////////////////////////////////////////////////

// Gather the credential information of the impersonated user.

//

Console.WriteLine("Before impersonation ...");

Console.WriteLine("Current user is {0}",

WindowsIdentity.GetCurrent().Name);

Console.WriteLine("Input user name");

string username = Console.ReadLine();

Console.WriteLine("Input domain name");

string domain = Console.ReadLine();

Console.WriteLine("Input password");

SecureString password = ImpersonateUser.GetPassword();

/////////////////////////////////////////////////////////////////////

// Impersonate the specified user. The impersonation is automatically

// undone after the Impersonate method.

//

ImpersonateUser.Impersonate<object, object>(username, domain, password, null,

delegate

{

Console.WriteLine("\nDuring impersonation ...");

Console.WriteLine("Current user is {0}",

WindowsIdentity.GetCurrent().Name);

// Do the work as the user ...

ServiceController[] scList = ServiceController.GetServices("remote machine name");

foreach (ServiceController sc in scList)

{

Console.WriteLine("{2}: [{1}] {0}", sc.DisplayName, sc.Status.ToString(), sc.MachineName);

}

return null;

});

Console.WriteLine("\nAfter impersonation is undone ...");

Console.WriteLine("Current user is {0}", WindowsIdentity.GetCurrent().Name);

Console.ReadLine();

}

}

热心网友 时间:2023-10-06 13:11

不是很理解!能否详细点?

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com