我的批处理文件在传递文件(.mkv)时无法实现调用命令,但在没有参数的情况下直接运行时可以工作。下班后的命令包括运行带参数的 vlc。
call "C:\Users\****\Desktop\System Tools\Monitors\Primary2.bat"
start "VLC media player.lnk" %1
如果这很重要,请在 Windows 7 上运行。
更新:似乎调用函数不想与primary2.bat一起使用,但将使用一个更简单的批处理文件来完成primary2.bat所做的事情之一
用于比较primary2.bat
@ECHO off
IF Exist Single.txt (
IF EXIST Primary1.txt (
echo Primary Screen Set to Two >> Primary2.txt
del /q Primary1.txt
echo Triple Monitors enabled >> Triple.txt
del /q Single.txt
If Exist HDMI.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleHDMI\TripleHDMI Primary2.lnk"
)
IF Exist VGA.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleVGA\TripleVGA Primary2.lnk"
)
)
)
IF Exist Dual.txt (
IF EXIST Primary1.txt (
echo Primary Screen Set to Two >> Primary2.txt
del /q Primary1.txt
echo Triple Monitors enabled >> Triple.txt
del /q Dual.txt
If Exist HDMI.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleHDMI\TripleHDMI Primary2.lnk"
)
IF Exist VGA.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleVGA\TripleVGA Primary2.lnk"
)
)
IF EXIST Primary3.txt (
echo Primary Screen Set to Two >> Primary2.txt
del /q Primary3.txt
echo Triple Monitors enabled >> Triple.txt
del /q Dual.txt
If Exist HDMI.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleHDMI\TripleHDMI Primary2.lnk"
)
IF Exist VGA.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleVGA\TripleVGA Primary2.lnk"
)
)
)
IF Exist Triple.txt (
IF EXIST Primary1.txt (
echo Primary Screen Set to Two >> Primary2.txt
del /q Primary1.txt
If Exist HDMI.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleHDMI\TripleHDMI Primary2.lnk"
)
IF Exist VGA.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleVGA\TripleVGA Primary2.lnk"
)
)
IF EXIST Primary3.txt (
echo Primary Screen Set to Two >> Primary2.txt
del /q Primary3.txt
If Exist HDMI.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleHDMI\TripleHDMI Primary2.lnk"
)
IF Exist VGA.txt (
"C:\Users\****\Desktop\System Tools\Monitors\TripleVGA\TripleVGA Primary2.lnk"
)
)
)
hello.bat 用它来测试,这个有效
echo hello
"C:\Users\****\Desktop\System Tools\Monitors\TripleHDMI\TripleHDMI Primary2.lnk"
)
pause
两者都单独工作