Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何运行已启动程序的窗口_Batch File_Cmd - Fatal编程技术网

Batch file 如何运行已启动程序的窗口

Batch file 如何运行已启动程序的窗口,batch-file,cmd,Batch File,Cmd,我想运行一个.wav文件。这是我的 start”声音文件.wav 完全实用。但是如何运行标准windows soundplayer的窗口?所以我的观点不会改变 start”“SoundFile.wav/MIN start”“SoundFile.wav/min start”“SoundFile.wav-MIN start”“SoundFile.wav-min 我的工作不顺利。 你能帮助我吗? 欢迎。抱歉,我不熟悉stackoverflow,所以我无法理解,但我希望这足够了 简单地说,您可以使用如下

我想运行一个.wav文件。这是我的

start”声音文件.wav

完全实用。但是如何运行标准windows soundplayer的窗口?所以我的观点不会改变

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"
@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)
runmusic (name or full path with quotation marks)
以一种“专业的方式”,你可以做一个快捷方式文件,启动文件最小化。 它可能是有用的,如果你需要音乐有“艺术家标志”或类似的东西,也如果你不想使用CMD的所有时间

删除所有要执行的注释

Set WshShell = CreateObject ("Wscript.Shell")
strDesktop = "X:\Shortcutlocation\yoo"
Set Shortcut = WshShell.CreateShortcut(strDesktop + "\MusicNameMaybe.lnk")
Shortcut.WindowStyle = "7" 
Shortcut.IconLocation = "X:\IconPath\youricon.ico" // You can delete this and the file will be the same ever and forever. 
Shortcut.TargetPath = "X:\yourpath\music.mp3"
Shortcut.Save
如果你不想,你不必保留桌面上的快捷方式,甚至不必固定它们。例如:

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"
@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)
runmusic (name or full path with quotation marks)
现在你明白了,你甚至可以留下一个文件夹,里面放着歌曲,另一个文件夹里只放着定制的快捷方式,这很方便

希望这有帮助,

K.

运行
开始/?
并查看与
[命令/程序]
[参数]
相关的
/MIN
提到的位置。您是否尝试将
/MIN
移动到开始参数中?i、 e
start/MIN”““somecmd”
@TripeHound-在路径之后提到它。@Gerhard,是的,我提到了,结果是一样的:Groove Player(我没有更改默认程序)仍然完全打开,并且没有最小化。@Juliusciero它在
[/D path]
之后,这是启动in的目录,但是在发射之前。但是,如果
start”“/min soundfile.wav
不起作用,则可能是声音播放器启动后正在切换其显示模式,也可能是因为您启动了声音文件而不是播放器本身。您可以尝试
start”“/min wmplayer soundfile.wav
,看看这是否有帮助。是的,非常感谢:)Greet如果有帮助,您可以将答案设置为正确吗?非常感谢。是的,对不起,我忘了。非常感谢!我是一个感谢另一个的人!