更新时间:2023-01-14 14:21:39
我决定发布这个 Batch 文件解决方案的原因如下:
I decided to post this Batch file solution for the following reasons:
batch-file
标签.batch-file
tag..
@if (@CodeSection == @Batch) @then
@echo off
cscript //nologo //E:JScript "%~F0" < file.jnlp > file2.jnlp
goto :EOF
@end
// JScript section
WScript.Stdout.Write(WScript.Stdin.ReadAll().replace(
/(ruta_logo)|(ruta_xsl)|(url_msg)|(url_forest)|(nombre_entidad)|(url_word)/g,
function (o,A,B,C,D,E,F)
{return ["logo/logo.png","logo/xsl.xsl","url+msg","url+forest","Nombre","Word.exe"]
[[].concat(A,B,C,D,E,F).join().indexOf(o)] }));
作为一个额外的好处,这个解决方案应该比 PowerShell 运行得更快(恕我直言,它也更简单).
As an additional benefit, this solution should run faster than the PowerShell one (and IMHO it is simpler also).