我想运行一个.wav文件。这是
start "" SoundFile.wav
完全实用。但是,我如何运行窗口的标准窗口声音播放器最小化?所以我的观点没有改变?
start "" SoundFile.wav /MIN
start "" SoundFile.wav /min
start "" SoundFile.wav -MIN
start "" SoundFile.wav -min
遗憾的是没有起作用。你能帮我吗?问候。
对不起,我不熟悉stackoverflow,所以我不能让理解,但我希望这已经足够了。
用一种简单的方法,你可以使用这样的VBS:
s = createobject("WScript.Shell")
s.run "music.mp3", 2
或者创建一个自动和CLI程序来执行此操作:
runmusic.bat
@echo off
set music=%1
set music=%music:"=%
if ":" neq "%music:~1,1%" set music=%cd%%music%
if "%music:~-4%" neq ".mp3" set music=%music%.mp3
set katorn=%random%
echo >>"%temp%%katorn%.vbs" set s = createobject("WScript.Shell")
echo >>"%temp%%katorn%.vbs" s.run "%music%", 2
cscript "%temp%%katorn%.vbs"
:: Uncomment the next line to autodelete the vbs file.
:: del /q /f "%temp%%katorn%.vbs"
用法:
runmusic (name or full path with quotation marks)
在一个";专业的方式;你可以做一个快捷方式文件,启动文件最小化。如果你需要音乐来拥有";艺术家标志";或者类似的东西,如果你不想一直使用CMD。。。
删除所有要执行的注释。
Set WshShell = CreateObject ("Wscript.Shell")
strDesktop = "X:Shortcutlocationyoo"
Set Shortcut = WshShell.CreateShortcut(strDesktop + "MusicNameMaybe.lnk")
Shortcut.WindowStyle = "7"
Shortcut.IconLocation = "X:IconPathyouricon.ico" // You can delete this and the file will be the same ever and forever.
Shortcut.TargetPath = "X:yourpathmusic.mp3"
Shortcut.Save
如果你不想的话,你不必在桌面上保留快捷方式,你甚至不必固定它们。示例:
runmusic.bat
@echo off
set music=%1
set music=%music:"=%
if ":" neq "%music:~1,1%" set music=%cd%%music%
set music=%music%.mp3
set katorn=%random%
echo >>"%temp%%katorn%.vbs" Set WshShell = CreateObject ("Wscript.Shell")
echo >>"%temp%%katorn%.vbs" strDesktop = "%temp%"
echo >>"%temp%%katorn%.vbs" Set Shortcut = WshShell.CreateShortcut(strDesktop + "%katorn%.lnk")
echo >>"%temp%%katorn%.vbs" Shortcut.WindowStyle = "7"
echo >>"%temp%%katorn%.vbs" Shortcut.TargetPath = "%music%"
echo >>"%temp%%katorn%.vbs" Shortcut.Save
cscript "%temp%%katorn%.vbs"
:: Uncomment the next two lines to delete the temporary files.
:: del /q /f "%temp%%katorn%.vbs"
:: del /q /f "%temp%%katorn%.lnk"
echo Enjoy!
用法:
runmusic (name or full path with quotation marks)
现在你明白了,你甚至可以留下一个文件夹里有歌曲,另一个只留下定制的快捷方式,这会派上用场。
希望这能有所帮助,
K