Batch file 带有“bcdedit”的循环输出批处理文件

Batch file 带有“bcdedit”的循环输出批处理文件,batch-file,bcdedit,Batch File,Bcdedit,我试图理解批处理文件中的FOR循环。此代码: FOR /F %%V IN ('bcdedit') DO @echo %%V pause exit 给出此输出: C:\Users\me\Desktop>FOR /F %V IN ('bcdedit') DO @echo %V The Access C:\Users\me\Desktop>pause Press any key to continue . . . bcdedit是一个配置引导管理器的程序。 在控制台上运行bcdedi

我试图理解批处理文件中的FOR循环。此代码:

FOR /F %%V IN ('bcdedit') DO @echo %%V
pause
exit
给出此输出:

C:\Users\me\Desktop>FOR /F %V IN ('bcdedit') DO @echo %V
The
Access

C:\Users\me\Desktop>pause
Press any key to continue . . .
bcdedit是一个配置引导管理器的程序。 在控制台上运行bcdedit可以提供:

Windows Boot Manager                                                            
--------------------                                                            
identifier              {bootmgr}                                               
device                  partition=\Device\HarddiskVolume1                       
description             Windows Boot Manager                                    
locale                  en-US                                                   
inherit                 {globalsettings}                                        
integrityservices       Enable                                                  
default                 {current}                                               
resumeobject            {5af9a946-5290-11e3-bd93-d2aed7e9b7a5}                  
displayorder            {current}                                               
toolsdisplayorder       {memdiag}                                               
timeout                 30                                                      

Windows Boot Loader                                                             
-------------------                                                             
identifier              {current}                                               
device                  partition=C:                                            
path                    \Windows\system32\winload.exe                           
description             Windows 8.1                                             
locale                  en-US                                                   
inherit                 {bootloadersettings}                                    
recoverysequence        {5af9a948-5290-11e3-bd93-d2aed7e9b7a5}                  
integrityservices       Enable                                                  
recoveryenabled         Yes                                                     
allowedinmemorysettings 0x15000075                                              
osdevice                partition=C:                                            
systemroot              \Windows                                                
resumeobject            {5af9a946-5290-11e3-bd93-d2aed7e9b7a5}                  
nx                      OptIn                                                   
bootmenupolicy          Standard                                                
useplatformclock        Yes
这些单词和访问权限来自哪里?

我想试试

FOR /F "delims=" %V IN ('bcdedit') DO @echo %V
看看整条线

我建议访问可能是拒绝访问响应的第一个令牌

我会尝试

FOR /F "delims=" %V IN ('bcdedit') DO @echo %V
看看整条线


我建议访问可能是拒绝访问的响应的第一个令牌

您在没有管理员权限的情况下运行bcdedit,这将产生以下输出:

The boot configuration data store could not be opened.
Access is denied.

您的输出来自每行的第一个单词。确保您在提升的命令提示符下运行。

您在没有管理员权限的情况下运行bcdedit,这将产生以下输出:

The boot configuration data store could not be opened.
Access is denied.

您的输出来自每行的第一个单词。确保在提升的命令提示符下运行。

谢谢。但我尝试了你的代码,控制台窗口闪烁得如此之快,即使我在bat脚本的第二行有一个暂停。我必须使用%%V。为什么?还有一个问题,谢谢你。但我尝试了你的代码,控制台窗口闪烁得如此之快,即使我在bat脚本的第二行有一个暂停。我必须使用%%V。为什么?另一个时代的问题。。。