是否可以在批处理文件中嵌入VBScript?
我目前有一个使用
调用.VBS文件的.CMD文件cscript //NoLogo MyScript.vbs
但我更愿意只分发一个.CMD文件。
编辑:在没有生成中间文件的情况下,有一个类似的问题可以解答如何执行此操作:Is it possible to embed and execute VBScript within a batch file without using a temporary file?
答案 0 :(得分:8)
http://www.computerhope.com/forum/index.php?topic=103686.0
@echo off
echo This is batch
:wscript.echo "This VBScript"
:wscript.echo "Today is " & day(date) & "-" & month(date) & "-" & year(date)
findstr "^:" "%~sf0">temp.vbs & cscript //nologo temp.vbs & del temp.vbs
echo This is batch again