本文介绍了如何将此 vbs 转换为批处理文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
代码如下:
Set sapi=Createobject("sapi.spvoice")sapi.Speak ("正在准备你的文件...")
我想将它插入一个包含其他代码的批处理文件中.应该是这样的;
I want to insert it into a batch file with other codes in it. It would be something like this;
Start google chrome
Open a new command prompt tab
Go to stack overflow
*Set sapi=Createobject("sapi.spvoice")
sapi.Speak ("Please subscribe to AstralWolf")*
如何制作该代码 VBS - Batch?
How can I make that code VBS - Batch?
谢谢!
推荐答案
当您将其作为函数调用时,您可以通过简单的方式尝试:Call:Speak ""代码>
You can try like that by the easy way when you call it as a function : Call:Speak "<your message goes here>"
@echo off
Start "" chrome.exe "www.stackoverflow.com"
Call:Speak "Please subscribe to AstralWolf"
exit /b
::**********************************************
:Speak <msg>
(
echo Set sapi=Createobject("sapi.spvoice"^)
echo sapi.Speak("%~1"^)
)>"%tmp%\%~n0.vbs"
Cscript /nologo "%tmp%\%~n0.vbs"
Del "%tmp%\%~n0.vbs"
exit /b
::**********************************************
这篇关于如何将此 vbs 转换为批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!