请教一下如何调用 powershell, 谢谢回复
integer lb_returnstring ls_script = "d:\cr\pbl\utf-8.ps1" // 修改为实际脚本路径
string ls_command
// 构建执行命令
ls_command = 'powershell.exe -ExecutionPolicy Bypass -File ' + ls_script
// 执行转换
lb_return=Run(ls_command, Minimized!)
if lb_return=1 then
MessageBox("成功", "PowerShell脚本已启动")
else
MessageBox("错误", "无法启动PowerShell")
end if
如上代码 ,实际执行不成功, 不知道是什么原因,请大家帮忙看看,是什么原因
在powershell中 是可以执行成功的。 把utf-8.ps1内容贴一下 jma 发表于 2025-6-23 08:35
把utf-8.ps1内容贴一下
$inputFile = "d:\cr\pbl\test.html"
$content = Get-Content -Path $inputFile -Encoding Default
# 将内容写入UTF-8编码的文件
$outputFile = "d:\cr\pbl\test.html"
Set-Content -Path $outputFile -Value $content -Encoding UTF8
页:
[1]