@ECHO off
$BIOS= Get-WmiObject -computername "BAHRIATSG2-PC" -Namespace
root/hp/instrumentedBIOS -Class HP_BIOSSettingInterface
$BIOS.SetBIOSSetting('Setup Password','<utf-16/>TheBIOSPassword','<utf-16/>')
pause
Run Code Online (Sandbox Code Playgroud)
当我另存为.bat文件并运行时,它将无法正常运行,否则当我手动输入时,它将在Powershell中正常运行。