在64位操作系统上拒绝访问 [英] Access Denied on 64 Bit OS

查看:125
本文介绍了在64位操作系统上拒绝访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在32位操作系统上成功写入(注册表)和(系统驱动器),但不能在64位上执行相同操作。该程序是在32位Windows 7机器上使用VB.Net 2010 Professional开发的。可能是什么问题呢?这是我的代码的一部分。



I can successfully write to (registry) and (system drive) on a 32 bit operating system, but cannot do the same on a 64 bit. The program was developed using VB.Net 2010 Professional on a 32 bit windows 7 machine. What could be the problem? Here is part of my code.

If System.Environment.OSVersion.Version.Major >= 6 Then
   procInfo.Verb = "runas"
End If
Process.Start(procInfo)



显示用户帐户控制窗口,我输入正确的管理员密码,然后我收到拒绝访问错误消息。我尝试将'目标PC'选项更改为'任何CPU'或'x64',但仍然是相同的。任何想法?



[编辑 - 来自解决方案的OP代码


It does show a User Account Control window, and I enter the correct admin password, then i get an access denied error message. I tried changing the 'target PC' option to 'Any CPU' or 'x64' but still, same thing. Any ideas?


Dim sDate as date
 My.Computer.Registry.LocalMachine.CreateSubKey("SOFTWARE\Test")
 My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Test", "Date", sDate)

推荐答案

运行该exe作为以管理员身份运行权限。

这将解决您的问题
Run that exe as "Run as Administrator" privilege.
this will resolve your problem


这篇关于在64位操作系统上拒绝访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆