2Likes -
Est Moi
Triggering a Batch file.
I need a way to trigger a Batch file in XP Home to reset the Volume Control to zero.
I have found a program that will reset the volume, Post 3 HERE. Creating the Batch file is not a problem.
I need to trigger it on Shut Down but it would also need to work on Reboot and if possible Log Off as well.
There is a reference in the first link to Last Chance but I wondered if there was a way to do it without the additional program?
-
Administrator
Create a batch file that automatically mutes the system and followed by shutting down the computer.
The first line mutes the system volume. The second line waits for 5 seconds and then power off the computer. You can shorten the wait time to maybe 2-3 seconds.
nircmd.exe mutesysvolume 1
nircmd.exe cmdwait 5000 exitwin poweroff
Now whenever you want to shut down the computer, run the batch file.
To restart the computer with the volume automatically turn on again, put the batch file with the command:
nircmd.exe mutesysvolume 0
in Startup folder. Start > All Programs > Startup.
http://www.nirsoft.net/utils/nircmd.html
1 program does it all
-
The Specialist *
-
Est Moi

Originally Posted by
Raymond
Create a batch file that automatically mutes the system and followed by shutting down the computer.
The first line mutes the system volume. The second line waits for 5 seconds and then power off the computer. You can shorten the wait time to maybe 2-3 seconds.
nircmd.exe mutesysvolume 1
nircmd.exe cmdwait 5000 exitwin poweroff
Now whenever you want to shut down the computer, run the batch file.
To restart the computer with the volume automatically turn on again, put the batch file with the command:
nircmd.exe mutesysvolume 0
in Startup folder. Start > All Programs > Startup.
http://www.nirsoft.net/utils/nircmd.html
1 program does it all

Raymond,
Thanks for that it looks like a very useful program, I will have a read of what else is in the command list.
The command: 'nircmd.exe setsysvolume 0' will serve me better as I want to reset the volume rather than mute it.
My original idea was to have a batch file triggered by the shut down process rather than the other way round, so that wherever the shut down command originated from, the batch file would still run.
Apparently you can do that in XP Pro using gpedit which is not included in XP Home.
I was thinking that there must be something in the OS that ran at shut down/reboot/log off which could be used as a trigger.
While I have been writing this I realised that I have a program ilSystem Wiper which runs at every shut down/etc, perhaps I could trigger the batch file with that?
The logic in either case would be: if x (System Wiper?) = 1, y (batch file) = 1.
The alternative of course would be to add the reset command to the Startup folder but I was trying to avoid adding anything to the startup process if I could.
-
Administrator
gpedit would be the best option since it is made available in Windows.
Although Windows XP Home doesn't have Group Policy Editor, you can still make the registry changes and it will take effect.
There is a tip on how to enable Group Policy Editor on XP Home.
http://www.mydigitallife.info/instal...-home-edition/
If you just want the registry key, I'll need to re-image my test setup to XP and then sniff for registry changes.
Will get back to this in a few hours.
-
Est Moi

Originally Posted by
Raymond
gpedit would be the best option since it is made available in Windows.
Although Windows XP Home doesn't have Group Policy Editor, you can still make the registry changes and it will take effect.
There is a tip on how to enable Group Policy Editor on XP Home.
http://www.mydigitallife.info/instal...-home-edition/
If you just want the registry key, I'll need to re-image my test setup to XP and then sniff for registry changes.
Will get back to this in a few hours.
I previously installed Group Policy Editor using the information on THIS website which I suspect has the same information as your link.
I never had any problems with the installation but two or three things that I tried to use it for never worked so I removed it again.
I have had it in mind to give it another try so before you spend time changing your test setup I will reinstall it again and give it a try.
I need to look up what I need to do regarding the settings that I want but they were listed on one of the sites I looked at recently so I just need to find them again.
Do you have any experience of using Group Policy Editor on XP Home as I would be interested in knowing how effective it is from someone with a greater understanding of it?
-
Administrator
I have always been using the Professional version of XP, and during that time I learned that XP Home does not have gpsec but still possible to enable it manually through registry.
I've added run.bat during Windows XP shutdown and got the following registry changes.
http://www.mediafire.com/?0fnarmzassm7d7r
All you need to do is change the path to the batch file in the registry files and import it to your Windows registry.
Try shutting down your computer and see if the system volume is set to 0 or not.
-
Est Moi
Thanks Raymond, I will not be able to try it before tomorrow.
I installed Group Policy Editor using the method in your link, I opened the GUI and entered the correct details, everything seemed fine but when I rebooted it never worked although if I ran the batch file directly it did. I also tried a number of simple modifications with GPEdit that I found on the web and although they seemed to be accepted they did not work either, which is what happened the last time I installed it.
---------- Post added 02-05-2012 at 12:28 PM ---------- Previous post was 02-04-2012 at 07:40 PM ----------
The registry keys were already there with the correct paths for my computer but it never worked, just like all the other things that I have tried with Group Policy Editor.
I have come to the conclusion that either XP Home is short of more files than are in the download or possibly some modification I have made to my system is preventing it from working.
For the moment I have created a direct shortcut (no batch file) to SetVol.exe in the Startup folder adding the parameters to the shortcut target, that works.
I spent some more time running searches about this and turned up another program similar to Last Chance:
Karen's Show Stopper
I also found an article suggesting that you can do the same thing without third party software:
Windows Tips
The searches also turned up two free-software sites that I have never heard of, at least one of which has some interesting programs on it. When I have had a better look at them if I think they might be of interest to others I will post the links on a separate thread.
-
Administrator
At first I thought the tip posted at pcworld was for real and was wondering how can I miss this tip but unfortunately it does not work after putting it to test on XP Professional SP3.
http://www.pcworld.com/article/115628/windows_tips_make_windows_start_and_stop_the_way_you_want.html
Going to test further on other methods and will get back to you.
---------- Post added at 09:42 PM ---------- Previous post was at 09:34 PM ----------
As for iISystem Wiper, the "Wipe on Shutdown" command only works if iISystem Wiper process is running in background. If it is terminated, the option won't work. Seeing that it has plugin support, I thought that maybe I could create a plugin that runs the batch file, but the plugin system only supports "delete" and "clear" commands. I'll try to get my hands on XP Home to test the gpedit registry.
-
Est Moi
Raymond,
I really appreciate your efforts but please do not put yourself to too much trouble, running the shortcut at startup does not appear to be causing any problems, not even on my Netbook, and the program is so small it is not adding to startup times.
Also the way that I have it now seems to work with shut down, reboot, and log off. To cover each of those at the end (shut down, etc) rather than the beginning (startup) would, unless I am mistaken, require three shortcuts not one.
I had not got as far as trying the PCWorld tip but it had occurred to me that provided you entered the correct paths you did not need to create an actual Shutdown folder.
I am surprised it did not work although I felt he might have been complicating things, then again he was looking at running several batch files/programs.
I looked up the usage for shutdown.exe and that part looked alright, which would leave, for my purposes, just placing a command to run setvol.exe in front of the command for shutdown.exe, as I am writing this I am wondering if it could be done using just a shortcut and doing away with the batch file as I have done at present?
I am thinking of the shortcuts I use for browsers and email programs using Drop My Rights where the targets for the shortcuts show up like this: "C:\Program Files\DropMyRights\DropMyRights.exe" "C:\Program Files\Mozilla Firefox\firefox.exe"
If I use the same method using setvol.exe first and then shutdown.exe second, including of course the parameters...?
When I have a minute I will give that a try, as it will not involve either batch files or editing the registry it should be straightforward and either work or not. Then again it would still require three shortcuts to cover the different shut down options.
I do have System Wiper running all the time, as it uses less than 700KB of memory I have never thought about shutting it down. My thought on that was to see if I could find out what triggered the "Wipe on Shutdown" action and use the same thing to trigger setvol.exe but all I found was an enable/disable key for it in the registry.
All times are GMT +8. The time now is 01:11 AM.