Current location - Music Encyclopedia - QQ Music - How to use code to call Microsoft's music player and computer in my Java project!
How to use code to call Microsoft's music player and computer in my Java project!

Runtime.getRuntime().exec("C:/Program Files/Windows Media Player/wmplayer.exe");

Runtime.getRuntime().exec("C: /WINDOWS/system32/calc.exe");

The paths in the two lines of code are all on my machine. You need to change them to the paths on your machine. If the system is installed on the c drive by default, The path should not need to be changed