Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Windows Media Player cannot open MP3 files

Windows Media Player cannot open MP3 files

Scheduled Pinned Locked Moved Visual Basic
questionlinuxhelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tatchung
    wrote on last edited by
    #1

    Hi all, I'm currently working on an application that opens media files with respect to their file extensions. Images are opened with Microsoft image viewer, video is opened with VLC and mp3 is supposed to be played with windows media player/VLC. So far opening images works fine but when I try to open video or music files i get the error that the opened application is unable to play the file.I'm positive that It has something to do with the spaces on the file location e.g. c:\Program Files\Windows Media Player\something.mp3. Question is how do I make it that the location doesn't incur any spaces or is there another way to open the files in their respective application aside from what I've been doing. I'm using vb6 by the way. Below are the codes I use for my task: Images

    Shell "rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & txtscreenshot.Text & "", vbMaximizedFocus

    Video

    Shell ("C:\Program Files\VideoLAN\VLC\vlc.exe " & txtscreenshot.Text & ""), vbNormalFocus

    Music

    Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & txtscreenshot.Text & "", vbNormalFocus

    Many thanks for all your replies! :-D

    L 1 Reply Last reply
    0
    • T tatchung

      Hi all, I'm currently working on an application that opens media files with respect to their file extensions. Images are opened with Microsoft image viewer, video is opened with VLC and mp3 is supposed to be played with windows media player/VLC. So far opening images works fine but when I try to open video or music files i get the error that the opened application is unable to play the file.I'm positive that It has something to do with the spaces on the file location e.g. c:\Program Files\Windows Media Player\something.mp3. Question is how do I make it that the location doesn't incur any spaces or is there another way to open the files in their respective application aside from what I've been doing. I'm using vb6 by the way. Below are the codes I use for my task: Images

      Shell "rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & txtscreenshot.Text & "", vbMaximizedFocus

      Video

      Shell ("C:\Program Files\VideoLAN\VLC\vlc.exe " & txtscreenshot.Text & ""), vbNormalFocus

      Music

      Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & txtscreenshot.Text & "", vbNormalFocus

      Many thanks for all your replies! :-D

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Shell "C:\Program Files\Windows Media Player\wmplayer.exe '" & txtscreenshot.Text & "'", vbNormalFocus

      Notice the extra quotes around "txtscreenshot.Text" :)

      tatchung wrote:

      I'm using vb6

      ..why? VB.NET is a free download, check out Visual Basic.NET Express :)

      I are troll :)

      T 1 Reply Last reply
      0
      • L Lost User

        Shell "C:\Program Files\Windows Media Player\wmplayer.exe '" & txtscreenshot.Text & "'", vbNormalFocus

        Notice the extra quotes around "txtscreenshot.Text" :)

        tatchung wrote:

        I'm using vb6

        ..why? VB.NET is a free download, check out Visual Basic.NET Express :)

        I are troll :)

        T Offline
        T Offline
        tatchung
        wrote on last edited by
        #3

        Hi! Thanks for the reply :)

        Eddy Vluggen wrote:

        Notice the extra quotes around "txtscreenshot.Text" Smile

        Yeah I've tried removing that quote but it still doesn't open. So in static "txtscreenshot.Text" generates path names like "C:\Documents and Settings\Computer1\Desktop\New\something.mp3". Shell command recognizes "C:\Documents" as 1 file "and" as another and so on. How can I make it recognize the path name as it is?

        Eddy Vluggen wrote:

        ..why? VB.NET is a free download, check out Visual Basic.NET Express Smile

        I know...that's a great deal of my problem :laugh: ;P

        Aim small, miss small

        C L 2 Replies Last reply
        0
        • T tatchung

          Hi! Thanks for the reply :)

          Eddy Vluggen wrote:

          Notice the extra quotes around "txtscreenshot.Text" Smile

          Yeah I've tried removing that quote but it still doesn't open. So in static "txtscreenshot.Text" generates path names like "C:\Documents and Settings\Computer1\Desktop\New\something.mp3". Shell command recognizes "C:\Documents" as 1 file "and" as another and so on. How can I make it recognize the path name as it is?

          Eddy Vluggen wrote:

          ..why? VB.NET is a free download, check out Visual Basic.NET Express Smile

          I know...that's a great deal of my problem :laugh: ;P

          Aim small, miss small

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          tatchung wrote:

          I know...that's a great deal of my problem

          What does this mean ? VB6 was always crap, and it's been unsupported for a long time. In VB.NET, you drag a WMP control onto your form and tell it what to play, easy.

          Christian Graus Driven to the arms of OSX by Vista.

          T 1 Reply Last reply
          0
          • T tatchung

            Hi! Thanks for the reply :)

            Eddy Vluggen wrote:

            Notice the extra quotes around "txtscreenshot.Text" Smile

            Yeah I've tried removing that quote but it still doesn't open. So in static "txtscreenshot.Text" generates path names like "C:\Documents and Settings\Computer1\Desktop\New\something.mp3". Shell command recognizes "C:\Documents" as 1 file "and" as another and so on. How can I make it recognize the path name as it is?

            Eddy Vluggen wrote:

            ..why? VB.NET is a free download, check out Visual Basic.NET Express Smile

            I know...that's a great deal of my problem :laugh: ;P

            Aim small, miss small

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Perhaps this one?

            Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & Chr(34) & txtscreenshot.Text & Chr34, vbNormalFocus

            The above code will put quotation-marks inside the command. That way Windows knows that the path doesn't end after the first space that it sees. Enjoy[^] :)

            I are troll :)

            T 1 Reply Last reply
            0
            • C Christian Graus

              tatchung wrote:

              I know...that's a great deal of my problem

              What does this mean ? VB6 was always crap, and it's been unsupported for a long time. In VB.NET, you drag a WMP control onto your form and tell it what to play, easy.

              Christian Graus Driven to the arms of OSX by Vista.

              T Offline
              T Offline
              tatchung
              wrote on last edited by
              #6

              Couldn't agree more...i meant using vb6 has been a burden for me. Unfortunately this was a requirement...client haven't, couldn't, wouldn't install a .NET framework for reasons they "wouldn't" disclose. Lotsa "'s"s in there :~

              Aim small, miss small

              1 Reply Last reply
              0
              • L Lost User

                Perhaps this one?

                Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & Chr(34) & txtscreenshot.Text & Chr34, vbNormalFocus

                The above code will put quotation-marks inside the command. That way Windows knows that the path doesn't end after the first space that it sees. Enjoy[^] :)

                I are troll :)

                T Offline
                T Offline
                tatchung
                wrote on last edited by
                #7

                Amazing...that really did the job. Thanks friend! I really appreciate that :thumbsup::thumbsup::thumbsup:

                Aim small, miss small

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups