gpt4 book ai didi

batch-file - 拖放到批处理文件后命令提示符保持打开状态

转载 作者:行者123 更新时间:2023-12-03 12:35:05 25 4
gpt4 key购买 nike

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

我试过了exit , cls , goto:eof@echo off一开始有几种不同的组合,但都没有成功。如何在打开 VLC 后关闭 cmd 窗口或从一开始就不显示?

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

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

最佳答案

试试这个批处理:

@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
'*********************************************************************************

关于batch-file - 拖放到批处理文件后命令提示符保持打开状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30958049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com