How to launch and play a song in wmp from java code

Hi,
I have this code. It launches wmp but it doesnt play the song. Thanks
String wmplayer = "C:\\Program Files\\Windows Media Player\\wmplayer.exe /prefetch:6 /Play ";
try{
Runtime.getRuntime().exec( wmplayer + "C:\\Program Files\\Windows Media Player\\CashRegister.wav" );
}catch( Exception e ){
System.out.println(e);
}

I wonder what exec does if the path to the program or the parameters have spaces in them?
Try getting it to work from the command line before trying to get exec() to run it.
Put quotes around "Program Files" and such

Similar Messages

  • How i can set dropDown item to 6th item from java code ?

    Hi
    Thank you for reading my post.
    how i can set dropDown item to 6th item from java code ?
    i have the value field of database and i can use it to set selected item of DropDown.
    so : can i use value field to set the selected item ?
    Thank u.

    Hi,
    Please go through the following thread which discusses about setting teh selected item for a dropdown:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50697
    Hope it helps
    Cheers
    Giri

  • How do I get my music to quit scrolling and stop and play a song?

    How do I get my music to quit scrolling and stop and play a song?

    Basically it means that the files are not on the location where iTunes is expecting to be.
    What you can do is remove those songs from you playlist, then try to locate them on your harddisk again, and then in iTunes you can choose file > Add folder to Library... , specify the location where you found them and they will be added again.

  • How can I stop iTunes from launching and playing by itself?

    iTunes launches and plays by itself, which is very annoying, given that there is no discernable reason for it to do so.
    Nothing in preferences should allow this. No device is connected. The library is not being shared.
    Has anyone found a solution to this?

    Check Dashboard to see if you have any iTunes-related widgets running. If so, close them and see if that makes a difference. Similarly, look for any third-party apps that may be related to iTunes, such as apps that copy "now playing" information to a web site.
    Another possibility is external speakers, if you have them. Another user here found that a loose speaker connection may cause random launching and playing on iTunes. Try wiggling the speaker plug and see if that causes iTunes to launch.  If so, unplugging and reconnecting the speakers may cure the problem. If not, you may have a defective speaker jack or an off-size plug on the speakers.
    Hope this helps.

  • When i go to my music and play a song it sounds like my headphones are blown but when i play songs on youtube they sound fine, can anyone explain this to me? please and thank you

    when i go to my music and play a song it sounds like my headphones are blown but when i play songs on youtube they sound fine, can anyone explain this to me? please and thank you

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.      

  • I can see other accounts on home share and play the songs, but not drag them to my account.  Home share is on "on" on both accounts and both computers are authorized.  What can I do to copy the song from account to account?

    I can see other accounts on home share and play the songs, but not drag them to my account.  Home share is on "on" on both accounts and both computers are authorized.  What can I do to copy the song from account to account?

    okasy if you want to move the music from the other comptuer into your comptuer you can > but if they were purchased with a different APPLE id then you need to authorize the comptuer to play them .
    http://support.apple.com/kb/HT4527
    click homesharing > shows how to move the song onto your comptuer

  • I open iTunes and try and play a song through my mac most of the songs come up locate? then the download from i tunes symbol comes up but when i try and download them it won't work and  also a lot of the songs are missing

    ok at time i open i tunes and try and play a song it says locate when i try and redownload it they don't work or are not on my iTunes !! but my i phone 6 is linked and sinked to this mac and it has all the songs and plays no problem

    Delete the references to them from the iTunes library and then either redownload them from the iTunes Store or use the Transfer Purchases function.
    (121569)

  • Can anybody explain me how to sample and play audio files with logic's EXS2

    can anybody explain me how to sample and play audio files with logic's EXS24 Sampler???
    i cant find a way to upload and manage my own audio content on this sampler...

    i uderstand , thanx...
    i managed to open an audio file and placed it in the sampler,i can play t sample in the little keyboard in the zones section, howver i dont know how to play it with my controller... the sample shows in C1 on logic's keyboard but if i play C1 on my controller nothing happens... how can i fix this?
    Also, i noticed the sample plays from beginning to end once i click on it, how do i do to just make it last until i release the key? like a logic sound??? (in case i want to play a small portion of the sample only)
    Thanx

  • HT5731 How to purchase and download a song to be burned onto a CD

    How to purchase and download a song to be burned onto a CD?

    Purchase the song.
    Make a playlist
    Click File>Burn to cd

  • Added movie (already converted to mp4 format) to iTunes library in my PC, syncronized to iPad2, now how to locate and play it in iPad2?

    Added movie (already converted to mp4 format) to iTunes library in my PC, syncronized to iPad2, now how to locate and play it in iPad2?

    On your computer's iTunes if you select that video and do 'get info' (control-I), then on the popup on the Options tab change it's 'Kind' to 'Movie' from 'Home Video'.
    To sync it to your iPad, connect the iPad and select it on the left-hand sidebar of your computer's iTunes (if you have iTunes 11 on your computer then you can enable the sidebar via option-command-S on a Mac, control-S on a PC), and then on the right-hand side use the Movies/Films tab to select and sync it to the iPad's Videos app.

  • Netflix turns on my I-Tunes and plays a song.

    If I turn on Netflix on my Apple TV, it works  -- but it also turns on my I-Tunes and plays a song.
    I walk over to my computer and turn it off, but it simply happens again next time I use the Apple TV remote.   (I-Tunes, and the first song in my playlist - which happens to be Aerosmith -  simply will not be defeated.  )
    The remote will override my computer's mute button, and even "sleep" mode.  Is there a setting here I need to change?

    If you don't want to use a remote with your computer the easiest thing to do is just to turn the IR off. (System Preferences > Security > General, click on the Advanced button in the bottom right corner - If the button is greyed out, click on the lock icon and enter your administrators password))
    If you still want to use your computer remote then you must pair your computers remote with the computerAND the Apple TV remote with the Apple TV.
    To pair a remote with a device hold down the menu and FF buttons together for six seconds or until you see a chain icon on screen (best take the computer into another room, or turn it off, when you do this)

  • How to download and save a song on Firefox ?

    when I want to download a song it goes through flash player only,plz tell me how to download and save a song on my phone using Firefox.
    I will be thankful to you.

    long press on flash and select save audio

  • Can't play the songs I bought from iStore

    I can't play the songs I bought from iStore.
    It complain about the autorization, but how much I try it seems like I can't get this computer to get authorized.
    I login to iStore with my only login account, buy the song, and it gets downloaded. Then when I try to play the song, I asks me again about the authorization. I use the same accout login, and it reply that this computer is now authorized... again. But the songs stil can't be played.
    If I click again on the song the same loop above repeats itself.
    Frustrastion = I can't play the songs I have bought.
    Anyone?
    M.

    I, also, have that authorization nonsense (I am the administrator, and only user of the computer). But, still, I cannot make any changes. You will have to report to someone at iTunes, if you try to play the downloaded songs from iTunes.
    Which version, has it always been that way?
    Also, did you change your username/password, if things were working fine, at one time?
    I had your problem when I, originally, signed up with my AOL address. When I quite AOL, I got an Apple id, and I could not access my songs from AOL days for over three months. Eventually, someone at Apple helped me.

  • How to install and use a plug-in downloaded from the apple site?

    how to install and use a plug-in downloaded from the apple site?

    Emelie,
    which plug-in do you want to install?
    some of the plug-ins come with an installer on the disk image, you click the installer and it will install it in its proper location.
    For others you move the plug-in into to System Library or your User Library:
      Your Hard disk  > Library > Application Support >Aperture > Plug-Ins > Edit
    or
    Your Home Folder > Library > Application Support >Aperture > Plug-Ins > Edit
    If it is an "Edit" plug-in, it goes into the "Edit" subfolder, "Export" plug-ins into the "Export" subfolder.
    You can tell by the extension, what kind of plug-in it is.
    E.G. BorderFX.ApertureExport is an export plug-in, BorderFXEditPlugin.ApertureEdit an edit plug-in.
    Regards
    Léonie
    P.S. In OS Lion the Libraries are hidden by default: To reveal your User Library activate the Finder and select from the main Finder menu:
        Finder >  Go , then hold down the ⌥-option-key, untill the Library appears in the drop.down menu.
    To show the System Library:
         Finder >  Go > Go to Folder
    then enter   / Library

  • How To Generate And Print Reports In PDF Format From EBS With The UTF8 Char

    Hi,
    I want to know How To Generate And Print Reports In PDF Format From EBS With The UTF8 Character Set in R12.0.4.
    Regards

    Refer to Note: 239196.1 - PASTA 3.0 Release Information
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=239196.1
    Or, you can use XML Publisher.
    Note: 551591.1 - Need Latest XML Publisher / BI Publisher Patches For R12
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=551591.1

Maybe you are looking for