jp said:
Pegasus (MVP) said:
System: Windows XP
I currently have a batch file in my startup folder to launch the sheet.
It
is simply written as:
"rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl"
Once the sheet is up, I have to manually check "Place volume icon in
task
bar", then click [OK].
Is there a way via the batch file to automate this process so that the
batch
file itself will both check the box and OK it's way out?
Don't ask why I have to do this - it's image-related. It's the only way
I
can get the volume icon on the taskbar.
Thanks in advance.
jp
This batch/VB Script hybrid works on my machine. Please note that it is
fragile: If a pop-up message interferes with it, e.g. a virus pattern
file
update then it will fail.
@echo off
set delay=5000
start /b "" rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl
echo > "%temp%\Send.vbs" Set ws=CreateObject("WScript.Shell")
echo >>"%temp%\Send.vbs" WScript.Sleep(%delay%)
echo >>"%temp%\Send.vbs" ws.sendkeys("{Enter}")
cscript //nologo "%temp%\Send.vbs"
Hi Pegasus,
Thank you for your time. The batch/script didn't work. The property sheet
does come up *and* go away on it's own, but the options and OK button are
not
executed. I even tried to fiddle with the delay you had set in there
(making
it longer) to no avail. You did issue the caveat that it was fragile and
I'm
wondering whether or not the McAfee ePolicy Orchestrator and/or Host
Intrusion Prevention (neither of which do I have any admin control over)
are
precluding this batch/script?
You need to play a little more with the navigation keys that move you from
one tick box to the next, e.g. like so:
@echo off
set delay=5000
start /b "" rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl
echo > "%temp%\Send.vbs" Set ws=CreateObject("WScript.Shell")
echo >>"%temp%\Send.vbs" WScript.Sleep(%delay%)
echo >>"%temp%\Send.vbs" ws.sendkeys("{Tab}")
echo >>"%temp%\Send.vbs" WScript.Sleep(500)
echo >>"%temp%\Send.vbs" ws.sendkeys("{Tab}")
echo >>"%temp%\Send.vbs" WScript.Sleep(500)
echo >>"%temp%\Send.vbs" ws.sendkeys(" ")
echo >>"%temp%\Send.vbs" WScript.Sleep(5000)
echo >>"%temp%\Send.vbs" ws.sendkeys("{Enter}")
cscript //nologo "%temp%\Send.vbs"
Again this script is fragile: It will toggle the contents of the tick box,
regardless of what's there before. A direct registry hack might be far more
robust.
After finishing your testing session, you should temove the 5000 millisecond
delay before issuing the Enter command.