Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does my Batch fail to call when passed file?
    primarykey
    data
    text
    <p>My batch file fails to implement the call command when passed a file (.mkv), but works when ran directly with no parameters. The commands after work including running vlc with arguments.</p> <pre><code>call "C:\Users\****\Desktop\System Tools\Monitors\Primary2.bat" start "VLC media player.lnk" %1 </code></pre> <p>running on windows 7 if that matters.</p> <p><strong>update:</strong> It seems that the call function does not want to work with primary2.bat, but will work with a much simpler batch file that does one of the things primary2.bat does</p> <p>for comparison primary2.bat</p> <pre><code>@ECHO off IF Exist Single.txt ( IF EXIST Primary1.txt ( echo Primary Screen Set to Two &gt;&gt; Primary2.txt del /q Primary1.txt echo Triple Monitors enabled &gt;&gt; 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 &gt;&gt; Primary2.txt del /q Primary1.txt echo Triple Monitors enabled &gt;&gt; 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 &gt;&gt; Primary2.txt del /q Primary3.txt echo Triple Monitors enabled &gt;&gt; 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 &gt;&gt; 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 &gt;&gt; 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" ) ) ) </code></pre> <p>hello.bat used it to test, this one works</p> <pre><code>echo hello "C:\Users\****\Desktop\System Tools\Monitors\TripleHDMI\TripleHDMI Primary2.lnk" ) pause </code></pre> <p>both work individually</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload