2014-01-16 50 views
0

我的最终目标是:BAT START W /命令认可

  • 将&删除视频选择到批处理文件
  • VLC运行与选择为播放列表,并在年底
  • GlovePIE同时加载关闭,运行该脚本
  • 电脑关机时,VLC关闭
  • 用户可以一个键取消关机(二是精细)

我试图把它放在一起,但它惨不忍睹...... GlovePIE语法不适用于START操作,但我不知道另一种方式来同时运行这两个程序。我试图制作一个运行VLC.bat和GlovePIE.bat的蝙蝠,但我不知道如何在Launcher.bat和VLC.bat之间传递变量。不管怎么说,有它作为一个单一的蝙蝠似乎是一个更好的主意,我...


我有什么至今:

@echo off 
if exist "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" (
start "" "C:\Program Files\GlovePIE045Free\piefree.exe" -"C:\Program Files\GlovePIE045Free\CustomScripts\xbox360VLCremote.PIE" /tray 
start /wait "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 vlc://quit 
) else (goto :EOF) 
taskkill /f /im piefree.exe 
cls 
choice /c CP /D P /T 120 /M "Waiting for 120 seconds: Press C to cancel shutdown, or P to power off now" 
if errorlevel 2 shutdown -s 

这是加载GlovePIE正常,但多个视频的不被注意到。

+0

一个很好的调试批处理文件的方法是在行的前面加一个'echo',这会给你带来麻烦。通常情况下,您会发现变量扩展中存在错误,或者您需要用双引号括住某些内容(例如*如果文件名/路径中有空格)。 – paddy

+0

哦,我的......问题是我没有'START' VLC行的标题......增加了'“”',现在它可以工作。 – Zer0Ry0k0

回答

1

我不能对此进行测试,但我想尝试

start /wait "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %* vlc://quit 

注:一对额外的引号。这设置了START编辑会话的标题,否则使用第一个"quoted string"

%*表示allcommand-line arguments%10无效,只有%1..%9可用。 %10将被解释为%1并附加0


进一步想:如果clasically放置在一个块(发言parenthesised序列)时失败,那么,重组的代码,但你可以尝试

for /f "delims=" %%z in ("%*") do start /wait "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %%z vlc://quit 

(理论:有在参数通过)

+0

oooooh,这就是为什么我会得到第一个文件名的奇数输出。谢谢。这条线是独立工作的,但是当我将它放在()中时,它不会加载多个电影。 =( – Zer0Ry0k0

0

这是已完成的工作代码。感谢大家的帮助。

@echo off 
if exist "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" (
start "" "C:\Program Files\GlovePIE045Free\piefree.exe" -"C:\Program Files\GlovePIE045Free\CustomScripts\xbox360VLCremote.PIE" /tray 
start /wait "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %* vlc://quit 
) else (goto :EOF) 
taskkill /f /im piefree.exe 
cls 
choice /c CP /D P /T 120 /M "Waiting for 120 seconds: Press C to cancel shutdown, or P to power off now" 
if errorlevel 2 shutdown -s