使用 PowerShell

由於 powershell 預設安裝在每個 Windows 系統上,從 2008 年 7 月開始,它可以用於更復雜的計算:

@echo off
set "expression=(2+3)*10/1000"
for /f %%# in ('"powershell %expression%"') do set result=%%#
echo %result%

請注意 for /f 中的其他雙引號,以防止括號與 for 命令語法衝突。

可能的問題是,由於 .net framerwork 的載入,powershell 比使用 wsh / vbscript / jscript 慢得多