Send pause command to vlc?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Heinen
Posts: 4
Joined: 11 Apr 2013 00:30

Send pause command to vlc?

#1 Post by Heinen » 14 Apr 2013 10:05

Hello, i need to know how to send a pause/start command to a program, vlc media player.

I have been googling like a maniac but still didn't find anything.

Thnx so much for your time!

Endoro
Posts: 244
Joined: 27 Mar 2013 01:29
Location: Bozen

Re: Send pause command to vlc?

#2 Post by Endoro » 14 Apr 2013 10:28

Take AutoIt and send a <space> to the VLC window.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Send pause command to vlc?

#3 Post by abc0502 » 15 Apr 2013 18:30

Alos, VBscript can do that, try this code, it will open a notepad and write text in and save it in your D drive

Code: Select all

@Echo OFF

(   FOR /F "tokens=1*" %%a IN ('findstr "^:write: " ^< "%~F0"') DO Echo.%%b    )>"%~DP0write.vbs"
Cscript //nologo "%~DP0write.vbs"

Exit

:write: Dim WshShell
:write: Set WshShell = WScript.CreateObject("WScript.Shell")
:write: WshShell.Run("cmd /c notepad.exe")
:write: WScript.Sleep 1000         ' five seconds as a delay
:write: WshShell.SendKeys "Welcome to DosTips.com{ENTER}^sD:\dotsips.txt"
:write:
REM Leave Empty Line after this one

make sure to leave empty line at the end of this batch,

The code work on the active window, so if you wanted to apply that to your vlc, it must be the active window in that moment, to send a space bar key, replace "Welcome to DosTips.com{ENTER}^sD:\dotsips.txt" with " " (single space)

adjust the 3000 as you need to make a delay (1000=1 seconds)
See Theis Topic for more keyboard keys : Link

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Send pause command to vlc?

#4 Post by Ed Dyreen » 15 Apr 2013 21:33

'
With vbScript there is no way to guarantee the window will be active during send.

Code: Select all

oWSH.AppActivate( title )
oWSH.SendKeys( " " )
autoIT knows

Code: Select all

If sendKeepActive( $title, $text ) Then send( "{SPACE}" )
Clicks are bulletproof.

Code: Select all

ControlClick( $title, $text, $controlID )

Post Reply