Running built-in beep sound from background process on Windows 10

31 Views Asked by At

I have a background service that's executing a java program on a Windows 10 machine.

I'm trying to make to built-in speaker beep. I found that the command powershell [console]::beep() works as I want to, but only when I'm executing it directly in the cmd terminal. Or if I launch my program from the command line.

The java program executes: Runtime.getRuntime().exec("cmd /c powershell [console]::beep()");

My problem is that the speaker doesn't beep when the the java process is launched in the background via a service.

Is there a permission problem that blocs the process from accessing the speaker output ? Or is [console] undefined when executing in the background so powershell can't execute the beep command ?

0

There are 0 best solutions below