Command prompt staying open after drag'n'drop onto batch file

1.3k views Asked by At

I'm running Windows 7 64-bit (library folders moved to E:, system still on C:). I am using someone's batch file to open VLC media player in full screen on my second display(left) and the control window on my primary display(right). The batch file is in my video library and I drag and drop a video file onto the batch file and everything is great EXCEPT the command prompt will not close until I close VLC.

I have tried exit, cls, goto:eof and @echo off at beginning in several different combinations with no success. How can I make the cmd window close after opening VLC or never show in the first place?

(please note that my cmd window takes up a majority of my primary screen because of how I use it for something completely unrelated, so no making it smaller and moving it won't work either.)

set vlcPath="C:\Program Files\VideoLAN\VLC\vlc.exe"

%vlcPath% %1 --video-x=-1920 --video-y=1080 --width=300 --height=300 --fullscreen --no-video-title-show --no-embedded-video --no-qt-fs-controller
1

There are 1 answers

2
Hackoo On

Try this batch :

@echo off
set vlcPath="C:\Program Files\VideoLAN\VLC\vlc.exe"
start "" %vlcPath% %1 --video-x=-1920 --video-y=1080 --width=300 --height=300 --fullscreen --no-video-title-show --no-embedded-video --no-qt-fs-controller
Exit

And this what i mean to do it with a vbscript :

Option Explicit
Dim vlcPath,video,Command,ws
If WScript.Arguments.Count > 0 Then
    video = WScript.Arguments.Item(0)
    vlcPath ="C:\Program Files\VideoLAN\VLC\vlc.exe"
    Command = DblQuote(vlcPath) & " " & DblQuote(video) &" --video-x=-1920 --video-y=1080 --width=300 --height=300 --fullscreen --no-video-title-show --no-embedded-video --no-qt-fs-controller"""
    'wscript.echo Command
    set ws = CreateObject("wscript.shell")
    ws.run Command,1,True
else
    wscript.echo "You must drag and drop any video over this script in order to open it in fullscreen"
end if
'*********************************************************************************
Function DblQuote(Str)
    DblQuote = Chr(34) & Str & Chr(34)
End Function
'*********************************************************************************