我需要运行我制作的这个脚本。该批次应该复制STM32 Nucleo上的编译程序。它用它wmic
来查找Nucleo的虚拟驱动器的标签:
@echo off
for /f %%D in ('wmic volume get DriveLetter^, Label ^| find "NODE_F446RE"') do set nucleo_drive=%%D
IF EXIST %D%\DETAILS.TXT (
IF EXIST main.bin (
@echo on
xcopy main.bin %D%
@echo off
echo Copied main.bin on nucleo
) ELSE (
echo Binary not found. Run `mingw32-make` in this directory to compile the project.
)
) ELSE (
echo Nucleo drive not found. If needed, edit the `find "NODE_F446RE"` part of this script to refference your nucleo volume name.
)
但我得到这个错误:
'wmic' is not recognized as an internal or external command, operable program or batch file.
我确保Windows Management Instrumenation服务正在运行。还有什么可能是错的?
wmic
,它应该居住C:\Windows\System32\wbem