locked
Need help creating a script! RRS feed

  • Question

  • Hello, i need help with creating a bat file or whatever in Windows.

    What i want to do is that i want to lower the volume (when i start the file) to, for example, 50.

    If possible, it would be cool if i could change the volume of different programs, for example, Battlefield 3 on 30, and everything else on 50.

    Thanks in advance!


    • Edited by RadjAvi Tuesday, February 28, 2012 5:22 PM A small detail change
    Tuesday, February 28, 2012 5:21 PM

Answers

  • There is actually a Powershell script for this in the repository, you can give this one a try:

    PowerShell Set PC Volume Control

    That might be able to achieve what you are attempting, you will require Powershell to be able to run this script though.

    Tuesday, February 28, 2012 7:23 PM

All replies

  • Adjusting the master volume on your pc via scripting is very, very hard to do.  Setting different volumes for different programs via script is simply impossible.  Forget it.

    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    Tuesday, February 28, 2012 5:29 PM
  • Sorry for posting like this, but i actually do have the time to learn it, and ive already tried but cant really find a good tutorial on how to work with this.
    Tuesday, February 28, 2012 5:34 PM
  • Oh is it really that hard? Isn't there just a simple command in cmd.exe or something?
    Tuesday, February 28, 2012 5:37 PM
  • Hi,

    It's possible to change volume with API calls, but it's not a simple script command. I imagine this is by design to prevent abuse.

    Bill

    Tuesday, February 28, 2012 6:16 PM
  • There is actually a Powershell script for this in the repository, you can give this one a try:

    PowerShell Set PC Volume Control

    That might be able to achieve what you are attempting, you will require Powershell to be able to run this script though.

    Tuesday, February 28, 2012 7:23 PM
  • That's jv's script, a subject of contention as to whether it is truly a "script", because most of the code is C#.

    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    Tuesday, February 28, 2012 7:31 PM
  • That's jv's script, a subject of contention as to whether it is truly a "script", because most of the code is C#.

    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    No one ever calined it was a script.  It is a fix for some deficiencie in WIndows but will not work well in Viata and later.


    ¯\_(ツ)_/¯

    Tuesday, February 28, 2012 8:32 PM
  • An alternative if you want to avoid Powershell and the C# road, you can also use nircmd.exe, a freeware tool that can be called from a batch file. It should work on Windows 7 as well.

    NirCmd v2.65

    This should do the trick:

    Minimum volume:
    nircmd.exe setsysvolume 0
    
    50% Volume:
    nircmd.exe setsysvolume 32767
    
    Max volume:
    nircmd.exe setsysvolume 65535

    Tuesday, February 28, 2012 9:02 PM