Jump to content

Recommended Posts

Posted

I have just imaged some machines (quite alot actually!!) and now realise that the volume on the machines is set to zero. We hide the system tray from students so they will have no way to adjust the volume.

 

Is there a way to set volume on remote computers via script or Group Policy? I have looked at the methods described in this thread http://www.edugeek.net/forums/network-classroom-management/6283-control-sound-remotely.html but they are not suitable in my environment.

Posted

I don't know of any way to control the volume remotely, but I might have an alternative for you!

 

We're similar here in that students have the system tray hidden, however, we put a shortcut in the Student Start Menu for "C:\Windows\System32\SndVol.exe" so they can still get the volume dialog up and adjust it as they wish.

 

Any help?

  • Thanks 1
Posted
I don't know of any way to control the volume remotely, but I might have an alternative for you!

 

We're similar here in that students have the system tray hidden, however, we put a shortcut in the Student Start Menu for "C:\Windows\System32\SndVol.exe" so they can still get the volume dialog up and adjust it as they wish.

 

Any help?

 

Possibly. Thanks

Posted

Asper this link

 

http://www.slyware.com/doku.php?id=software:scripts

 

Script to send the Virtual key codes

 

Volume UP = &hAF

Volume DOWN = &hAE

Mute Volume = &hAD

 


adjust_windows_volume.vbs
'S.Chudley (www.chudley.me) : Set Windows master volume (hAE = DOWN, hAF = UP)
Set WshShell = CreateObject("WScript.Shell")
For i=1 To 100
WshShell.SendKeys(chr(&hAF))
Next
[/Code]

 

Just a case of adjusting the code that the sendkeys line sends

 

Also if you only want it to increment the volume so far just adjust the value in the loop although the above may not be a viable solution because each time it runs it will increase the volume more

  • Thanks 1
Posted

Another option may be to use dot net whether vb or c sharp using the relevant audio API's etc to set the volume mixer lines ( which ever ones ) to a certain volume level so you can use gpo or gpp to launch the exe you create on startup or logon ?

 

Might have to do it with vbs / powershell or bat to execute the exe or failing that I did come across this

 

http://gallery.technet.microsoft.com/scriptcenter/PowerShell-Set-PC-Volume-1737b160

Posted
Asper this link

 

Useful Scripts [simon Robert Chudley]

 

Script to send the Virtual key codes

 

Volume UP = &hAF

Volume DOWN = &hAE

Mute Volume = &hAD

 


adjust_windows_volume.vbs
'S.Chudley (www.chudley.me) : Set Windows master volume (hAE = DOWN, hAF = UP)
Set WshShell = CreateObject("WScript.Shell")
For i=1 To 100
WshShell.SendKeys(chr(&hAF))
Next
[/Code]

 

Just a case of adjusting the code that the sendkeys line sends

 

Also if you only want it to increment the volume so far just adjust the value in the loop although the above may not be a viable solution because each time it runs it will increase the volume more

 

Thanks. Works on my machine. will try a remote test tomorrow.:whoo:

  • Thanks 1
Posted (edited)

Found the actual key codes which Im sure the above ones must equate to or be the same for them to work :

 

Virtual-Key Codes (Windows)

 

[TABLE=width: 740]

[TR]

[TD]VK_VOLUME_MUTE

0xAD[/TD]

[TD]Volume Mute key[/TD]

[/TR]

[TR]

[TD]VK_VOLUME_DOWN

0xAE[/TD]

[TD]Volume Down key[/TD]

[/TR]

[TR]

[TD]VK_VOLUME_UP

0xAF[/TD]

[TD]Volume Up key[/TD]

[/TR]

[/TABLE]

 

 

I bet @localz_uk or maybe even @nephilim could knock up an exe that could set the volume to a set level so that it does not matter that it keeps increasing it each time the script runs.

 

If not then I would be willing to have a go as am sure I had a vb 6 project that I could get converted to vb .net to set the volume to a specific level ??

Edited by mac_shinobi
Posted
Another option may be to use dot net whether vb or c sharp using the relevant audio API's etc to set the volume mixer lines ( which ever ones ) to a certain volume level so you can use gpo or gpp to launch the exe you create on startup or logon ?

If you were going to do that, why not simply use NirCmd instead of reinventing the wheel? :confused:

 

Setting the volume is as simple as running one of the commands below via a logon script and would also be more reliable than sending keystrokes.

 

[b]Volume Level    Command[/b]
25%             nircmd.exe setsysvolume 16384
50%             nircmd.exe setsysvolume 32768
75%             nircmd.exe setsysvolume 49151
100%            nircmd.exe setsysvolume 65535

  • Thanks 1
Posted (edited)
If you were going to do that, why not simply use NirCmd instead of reinventing the wheel? :confused:

 

Setting the volume is as simple as running one of the commands below via a logon script and would also be more reliable than sending keystrokes.

 

[b]Volume Level    Command[/b]
25%             nircmd.exe setsysvolume 16384
50%             nircmd.exe setsysvolume 32768
75%             nircmd.exe setsysvolume 49151
100%            nircmd.exe setsysvolume 65535

@Arthur

 

The nircmd suggestion was on the original thread that @fiza linked to hence why I didn't re suggest that

 

Although that is a cleaner solution

Edited by mac_shinobi
Posted (edited)
The nircmd suggestion was on the original thread that fiza linked to hence why I didn't re suggest that

That's my point. :)

 

I don't quite understand why NirCmd wouldn't be suitable, yet an EXE created in VB or C# would be? They both do the same thing. :confused:

 

Side note - which mixer lines does nircmd change ?

This one...

 

http://i.imgur.com/KfeYuCF.png

Edited by Arthur
  • Thanks 1
Posted (edited)
That's my point. :)

 

I don't quite understand why NirCmd wouldn't be suitable, yet an EXE created in VB or C# would be? They both do the same thing. :confused:

 

Ok fair play. Not arguing and that being the case nircmd looks like a better solution

 

Side note - which mixer lines does nircmd change ?

Edited by mac_shinobi
Posted
I tried running nircmd in our environment. I need to run it on remote PCs. Problem was that on the remote PC a dialogue box would pop up asking if I wanted to save nircmd to the windows directory. This is no good. I want to run it silently. The VB script idea @mac_shinobi suggested seems ideal.
  • Thanks 1
Posted (edited)
Problem was that on the remote PC a dialogue box would pop up asking if I wanted to save nircmd to the windows directory.

I think NirCmd only requires itself to be copied to the Windows folder if you use its 'remote' or 'multiremote' commands. If it is run in a logon script, NirCmd will effectively be running locally on each PC.

 

Alternatively, you could copy NirCmd to the Windows folder via Group Policy Preferences or PowerShell. e.g.

 

Get-Content X:\Computers.txt | ForEach { Copy-Item X:\NirCmd.exe -Destination \\$_\c$\Windows }

 

what is Tony's correct edugeek handle

@localzuk?

Edited by Arthur
  • Thanks 2
Posted
I think NirCmd only requires itself to be copied to the Windows folder if you use its 'remote' or 'multiremote' commands. If it is run in a logon script, NirCmd will effectively be running locally on each PC.

 

 

Did not know that! Thanks will give it a try.

  • Thanks 1
Posted
I think NirCmd only requires itself to be copied to the Windows folder if you use its 'remote' or 'multiremote' commands. If it is run in a logon script, NirCmd will effectively be running locally on each PC.

 

Alternatively, you could copy NirCmd to the Windows folder via Group Policy Preferences or PowerShell. e.g.

 

Get-Content X:\Computers.txt | ForEach { Copy-Item X:\NirCmd.exe -Destination \\$_\c$\Windows }

 

 

@localzuk?

 

Could you not have the nircmd exe located either in the sysvol / netlogon directory on the server and access it from there ( as all PC's ) should have access to that location if they are connected to the network which a startup script will only apply if they are connected to the network anyway

 

Would that not be a better option then having nircmd copied to each pc on the network ?

Posted
The thing with the script I did is it does not take into consideration if the script has already run , what level the volume is set to currently before it runs etc so if you run it again and then a 2nd time etc it will just keep increasing the volume on the pc until it is at maximum where as the nircmd solution will allow you to set the volume to a specific volume level regardless of what level it was on previously
Posted
The thing with the script I did is it does not take into consideration if the script has already run , what level the volume is set to currently before it runs etc so if you run it again and then a 2nd time etc it will just keep increasing the volume on the pc until it is at maximum where as the nircmd solution will allow you to set the volume to a specific volume level regardless of what level it was on previously

 

Yep that makes sense. Will try nircmd again using a logon script.

  • Thanks 1
  • 1 year later...
Posted

I just joined up so I could thank @mac_shinobi for posting that script.

 

A customer just asked me if there was any way to automate volume control as he schedules music to play at the same time every day and wanted to make sure the volume was correct. I embedded that code into a Macro script and it worked perfectly.

 

Also to add one more thing, in case others are looking for this, you can also toggle mute on and off :

 

  
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(&hAD))

  • Thanks 1
  • 2 months later...
Posted

I just needed to do this myself. A coworker is resigning today so i decided to troll him. We call him "mumm-ra", therefore the proper troll was to go lookup an old episode and rip the audio when mumm-ra transforms himself. So i used both nircmd and psexec which allowed me to raise his volume without him knowing, then i looked for a small mp3 console player without an UI, then used psexec with that mp3 player in order to play the mp3 silently at maximum volume.

 

Coffee was almost spilled. Trolling complete.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...