Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 拖动后命令提示符保持打开状态';n';放入批处理文件_Batch File_Vlc_Multiple Monitors - Fatal编程技术网

Batch file 拖动后命令提示符保持打开状态';n';放入批处理文件

Batch file 拖动后命令提示符保持打开状态';n';放入批处理文件,batch-file,vlc,multiple-monitors,Batch File,Vlc,Multiple Monitors,我正在运行64位Windows 7(库文件夹移动到E:,系统仍在C:)。我正在使用打开第二个显示器(左)上的VLC media player全屏和主显示器(右)上的控制窗口。批处理文件在我的视频库中,我将一个视频文件拖放到批处理文件上,一切都很好,除了命令提示符在我关闭VLC之前不会关闭 我在开始时尝试了几种不同的组合,如退出、cls、goto:eof和echo off,但都没有成功。如何在打开VLC后关闭cmd窗口,或者从一开始就不显示 (请注意,我的cmd窗口占据了我主屏幕的大部分,因为我是

我正在运行64位Windows 7(库文件夹移动到
E:
,系统仍在
C:
)。我正在使用打开第二个显示器(左)上的VLC media player全屏和主显示器(右)上的控制窗口。批处理文件在我的视频库中,我将一个视频文件拖放到批处理文件上,一切都很好,除了命令提示符在我关闭VLC之前不会关闭

我在开始时尝试了几种不同的组合,如退出、cls、goto:eof和echo off,但都没有成功。如何在打开VLC后关闭cmd窗口,或者从一开始就不显示

(请注意,我的cmd窗口占据了我主屏幕的大部分,因为我是如何将其用于完全不相关的事情的,所以不缩小它,移动它也不会起作用。)

请尝试此批次:

@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
这就是我用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
'*********************************************************************************

如果愿意,可以在隐藏控制台时从vbscript启动它!您可以指定或提供详细信息吗?您是否尝试使用Start命令?检查我的答案@hackoo请不要仅仅因为您认为另一种语言可能更适合解决手头的问题就将标签编辑成问题。你仍然可以用这种语言提出解决方案,只要你澄清为什么你认为这种方法优于OP最初的要求。很好,因此在这种情况下,当你看起来是一个新用户时,如果你得到一个有助于你的答案,请记住将其标记为已接受!查看此==>您也可以使用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
'*********************************************************************************