即使以管理员身份运行,在程序文件\myapp 中运行 rgsvr32 似乎也会失败
我们的软件需要能够在运行时注册 ocx。 OCX 位于应用程序的程序文件目录中。我发现,如果我以管理员身份手动启动 cmd 行并运行命令,一切都会很好,但是如果我以管理员身份启动我们的应用程序并让应用程序尝试注册 ocx,则会失败。我还注意到,当我从构建目录运行 regsvr32 时,该应用程序能够成功运行 regsvr32,大概是因为我拥有构建目录。但我仍然必须以管理员身份运行。任何人都知道可能出什么问题吗?
谢谢, 布莱恩
Our software needs to be able to register an ocx at runtime. The OCX lives in the program files directory of the app. I find that if I manually fire up a cmd line as admin and run the command everything works great, however if i fire up our app as admin and let the app try to register the ocx, it fails. I also notice that the app is able to run regsvr32 successfully when i run it from my build directory, presumably because i own the build dir. I still have to run as admin though. Anyone have any ideas what could be going wrong?
Thanks,
brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是,首先,我很草率,其次,传递到 regsvr32 的命令行参数需要用双引号引起来。我从来没有想到过,因为我这样写了我的代码:
当它应该看起来像:
希望这对其他人有帮助:)
The answer is firstly, that i'm sloppy, and secondly that the command line args passed into regsvr32 need to be wrapped in double quotes. It never occurred to me because i wrote my code like so:
when it should have looked like:
Hope this helps someone else :)