forked from npocmaka/batch.scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspplayer.bat
More file actions
28 lines (21 loc) · 689 Bytes
/
Copy pathspplayer.bat
File metadata and controls
28 lines (21 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@if (@X)==(@Y) @end /* JScript comment
@echo off
cscript //E:JScript //nologo "%~f0" %*
exit /b %errorlevel%
@if (@X)==(@Y) @end JScript comment */
if (WScript.Arguments.Length == 0) {
WScript.Echo(WScript.ScriptName + " file_to_play");
WScript.Quit(0)
}
var fso= new ActiveXObject("Scripting.FileSystemObject");
var file=WScript.Arguments.Item(0);
if (!fso.FileExists(file)){
WScript.Echo(file + " does not exist");
WScript.Echo("usage:");
WScript.Echo(WScript.ScriptName + " file_to_play");
WScript.Quit(1);
}
var spVoice = new ActiveXObject("SAPI.SpVoice");
var spFile = new ActiveXObject("SAPI.SpFileStream.1");
spFile.Open(file);
spVoice.SpeakStream(spFile);