1.

Solve : Batch File ~ Help Please?

Answer»

Halo All ,

I've got a problem. The LAN Cafe I work at can sometimes get too noisy with INCONSIDERATE users who blast their speakers to full volume. My boss has asked me find a way to restrict the volume level for each PC in Win XP at a certain standard. I've found this little command-line app which sets volume level and my idea is to run it at start-up through a batch FILE and then continue the batch file on a endless but timed loop. Problem is i cant figure out how to add a timer delayed loop which wouldn't allow any keyboard inputs to end it. Here's what i've got so far:

@echo off
:START
START "" /MIN /LOW D:\setvol.exe 10
GOTO START

I did some digging AROUND and found TYPE & CHOICE.COM but don't quite understand how to use them.

Alternatively I was thinking of editing or locking SNDVOL32.exe's values. But again not too sure.

Appreciate if anyone could help me out or if you've got a better solution do let me know.

Thank U gUys!!
Quote from: vAzazeLv on May 10, 2009, 02:33:09 AM

Halo All ,

I've got a problem. The LAN Cafe I work at can sometimes get too noisy with inconsiderate users who blast their speakers to full volume. My boss has asked me find a way to restrict the volume level for each PC in Win XP at a certain standard. I've found this little command-line app which sets volume level and my idea is to run it at start-up through a batch file and then continue the batch file on a endless but timed loop. Problem is i cant figure out how to add a timer delayed loop which wouldn't allow any keyboard inputs to end it. Here's what i've got so far:

@echo off
:START
START "" /MIN /LOW D:\setvol.exe 10
GOTO START

I did some digging around and found TYPE & CHOICE.COM but don't quite understand how to use them.

Alternatively I was thinking of editing or locking SNDVOL32.exe's values. But again not too sure.

Appreciate if anyone could help me out or if you've got a better solution do let me know.

Thank U gUys!!

Most people don't know about the pause/break thing, but if you add Code: [Select]ping localhost -n (Time in seconds) -w 1000 > nul somewhere in the loop, it should serve your purposes. If you don't want them to close it, then you can use the .exe I made just now to do it (it runs in "ghost mode").

[attachment deleted by admin]Or the Sleep command, if you have XP.

Parameters:
Code: [Select]Sleep [Seconds to Wait]
But if you want it in a more precise time, like in milliseconds then use Ping that Helpmeh advised.

Hope this helps
,Nick(macdad-)Quote from: macdad- on May 10, 2009, 03:08:26 PM
Or the Sleep command, if you have XP.

Parameters:
Code: [Select]Sleep [Seconds to Wait]
But if you want it in a more precise time, like in milliseconds then use Ping that Helpmeh advised.

Hope this helps
,Nick(macdad-)
You need to download it first...even if you have XP.Quote from: macdad-
But if you want it in a more precise time, like in milliseconds then use Ping

The sleep.exe I use (server 2003 resource kit) has a -m switch that specifies time in milliseconds

sleep -m 250

waits a quarter of a second.
Code: [Select]On Error Resume Next
comp=array(".")
q="select * from __InstanceCreationEvent within 1 where " & _
"targetinstance isa 'win32_process' and "& _
"(targetinstance.name='sndvol32.exe' or targetinstance.name='rundll32.exe')"
for each c in comp
set a=getobject("winmgmts:\\" & c).execnotificationquery(q)
do
a.nextevent.targetinstance.terminate
createobject("wscript.shell").run "d:\setvol.exe 10"
loop
next

vbscript alternative to prevent sndvol32.exe to run, save the above as prevent.vbs
Code: [Select]wscript prevent.vbs
to manage whole LAN, you can add each client computers name to the array and run the vbs from eg.cashier computer.
above code only tested on local computer.Thank you guys all soo much for the help & ADVICE for now I'm just using a simple batch file converted to exe with ping for the delay. Sleep & the vbscript idea definitely sounds PROMISING will give it a try and let you all know the outcome. Thanks once again


Discussion

No Comment Found