简体   繁体   English

Windows 8无法通过批处理运行注册表文件

[英]Windows 8 can't run Registry file via Batch

I'm trying to run a registry file silently in Windows 8 64 bit via the code given below in batch file but it doesn't work and when I run the registry file manually it works fine! 我正在尝试通过下面批处理文件中给出的代码在Windows 8 64位环境下静默运行注册表文件,但是它不起作用,当我手动运行注册表文件时,它可以正常运行! Also note that it's working in Windows 7 and Windows XP! 另请注意,它可以在Windows 7和Windows XP中使用! I just go this error after I installed Windows 8 64 Bit! 安装Windows 8 64位之后,我只会出现此错误!

       @echo off
       regedit /s abc.reg

This is how I run the registry file via batch file! 这就是我通过批处理文件运行注册表文件的方式! Let me know if anyone can solve this issue! 让我知道是否有人可以解决这个问题!

PS: I've tried running the batch file with Admin Privileges but no luck! PS:我尝试使用Admin Privileges运行批处理文件,但是没有运气!

Solved the issue by locating to the Path of the file. 通过找到文件的路径解决了该问题。

    @echo off
    SET myPath="%CD%\abc.reg"
    regedit /s %myPath%

通过使用窗口+ r-> regedit解决它,导航到此位置:“ HKEY_CURRENT_USER \\ Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Explorer \\ FileExts.BAT \\”并删除“ UserChoice”键

For windows 8 you can change the registry key values as shown below. 对于Windows 8,您可以更改注册表项值,如下所示。

[HKEY_CLASSES_ROOT.bat] @="batfile" [HKEY_CLASSES_ROOT.bat] @ =“ batfile”

[HKEY_CLASSES_ROOT.bat\\PersistentHandler] @="{5e941d80-bf96-11cd-b579-08002b30bfeb}" [HKEY_CLASSES_ROOT.bat \\ PersistentHandler] @ =“ {5e941d80-bf96-11cd-b579-08002b30bfeb}”

[HKEY_CLASSES_ROOT\\batfile\\shell\\open\\command] @="\\"%1\\" %*" [HKEY_CLASSES_ROOT \\ batfile \\ shell \\ open \\ command] @ =“ \\”%1 \\“%*”

Note: Deleting the "UserChoice" from "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts.BAT\\" works mainly in windows 7. You might not even find the .bat in FileExts for windows 8 注意:从“ HKEY_CURRENT_USER \\ Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Explorer \\ FileExts.BAT \\”中删除“ UserChoice”主要在Windows 7中进行。您甚至可能在Windows 8的FileExts中找不到.bat。

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

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