且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

运行命令行 &来自 VBS 的命令

更新时间:2023-11-17 08:18:58

问题出在这一行:

oShell.run "cmd.exe /C copy "S:ClaimsSound.wav" "C:WINDOWSMediaSound.wav"

S:Claims"旁边的第一个引号结束字符串;您需要使用第二个引号将文件周围的引号转义,如下所示:

Your first quote next to "S:Claims" ends the string; you need to escape the quotes around your files with a second quote, like this:

oShell.run "cmd.exe /C copy ""S:ClaimsSound.wav"" ""C:WINDOWSMediaSound.wav"" "

你在S:ClaimsSound.wav中也有错别字,应该是S:ClaimsSound.wav.

You also have a typo in S:ClaimsSound.wav, should be S:ClaimsSound.wav.

我还假设 Dim oShell 之前和 Set oShell = Nothing 之后的撇号也是拼写错误.

I also assume the apostrophe before Dim oShell and after Set oShell = Nothing are typos as well.