简体   繁体   English

无法从批处理文件中读取注册表

[英]Unable to read registry from batch file

I have a requirement where I need to use a batch file to perform certain tasks depending on some registry values. 我有一个要求,我需要使用批处理文件来执行某些任务,具体取决于某些注册表值。 I am able to run and achieve my goal if I run the batch file manually. 如果手动运行批处理文件,则可以运行并实现我的目标。 But if the batch is run using some executable it is not able to get the registry values. 但是,如果使用某些可执行文件运行该批处理,则它将无法获取注册表值。 It reads all the registry values as empty. 它将所有注册表值读取为空。 I don't see any particular reason for this behavior. 我看不到这种行为的任何特殊原因。 The actual requirement is to run this batch file as part of self extracting executable. 实际要求是将此批处理文件作为自解压可执行文件的一部分运行。 I tried it launching using C# application, still no luck. 我尝试使用C#应用程序启动它,但还是没有运气。 Any ideas? 有任何想法吗? what am I doing wrong. 我究竟做错了什么。

提升可执行文件的权限,即以管理员身份运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM