Using shell in a function

Exi

Registered User.
Local time
Today, 18:00
Joined
May 1, 2017
Messages
23
Hi Guys
I have a working function that plays a movie on a form from which ever selected movies command button is pressed.

Code:
 Function PlayVlcPlayer(pstrVlcfile As String)
Dim strVlcPlayer As String
   strVlcPlayer = Chr(34) & "C:\Program Files\VideoLAN\VLC\Vlc.exe " & Chr(34)
    
  Shell strVlcPlayer & Chr(34) & pstrVlcfile & Chr(34), vbMaximizedFocus
   
End Function
The pstrVlcfile is a string from a sub that gets the path from the table
eg:H:\2 Jacks (2012).mp4

The problem is I want to add --fullscreen after VLC.exe but when I do I get a file not found error in the shell line, take it out and it works fine.
I tried the same string in the run cmd and it works fine.
eg: C:\Program Files\VideoLAN\VLC\Vlc.exe --fullscreen "H:\2 Jacks (2012).mp4"
so any idea's would be appreciated.
 
I don't know if that would help.
Code:
 ..
  Dim procID As Integer
  procID = Shell(strVlcPlayer & Chr(34) & pstrVlcfile & Chr(34), vbMaximizedFocus)
 
Well I finally got there correct syntax was
Code:
Function PlayVlcPlayer(pstrVlcfile As String)
   Dim strVlcPlayer As String

   strVlcPlayer = Chr(34) & "C:\Program Files\VideoLAN\VLC\Vlc.exe" & Chr(34) & " --fullscreen " & Chr(34) & pstrVlcfile & Chr(34)
   Shell strVlcPlayer, vbMaximizedFocus
'
End Function
so now it runs Vlc in fullscreen mode.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom