小编Alo*_*one的帖子

如何在批处理文件中运行powershell命令

@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中正常运行。

powershell batch-file

1
推荐指数
2
解决办法
1万
查看次数

标签 统计

batch-file ×1

powershell ×1