How can I write a batch file that opens a file in a program?

Page 2 of 2 FirstFirst 12

  1. Posts : 1
    Windows 7 Enterprise x64
       #11

    The command window is waiting for vlc to finish so it can't close.

    You can get a windowless VBS script to do the same thing. Make a text file containing the following and call it RunVLCNoTaskbar.vbs or something similar and associate with your video files.
    Code:
    Set oWSH = CreateObject("WScript.Shell")
    
    s = ""
    for a = 0 to WScript.Arguments.Count - 1
      s = s & " " & WScript.Arguments(a)
    next
    
    Call RunWait("C:\Users\xxxxxx\Documents\HideTaskbar\HideTaskbar.exe")
    Call RunWait("""C:\Program Files (x86)\VideoLANold\VLC\vlc.exe"" " & s)
    Call RunWait("C:\Users\xxxxxx\Documents\HideTaskbar\ShowTaskbar.exe")
    
    WScript.Quit
    
    ' ***
    ' *** Function Definitions
    ' ***
    
    Sub RunWait (sTestEXE)
        Dim oExec
        Set oExec = oWSH.Exec(sTestEXE)
        Do While oExec.Status = 0
            WScript.Sleep 100
        Loop
    End Sub
      My Computer


  2. Posts : 83
    win7 64bit Ult. using: XP Mode, in English or Español, SUA, Bitlocker
       #12

    Ztruker said:
    Add %* after the call to VLC. That will pass all parameters given to the bat fil onto VLC>
    Pretty cool trick....
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 15:13.
Find Us