Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
Like Tree2Likes

Thread: Triggering a Batch file.

  1. #11
    Administrator
    Overall activity: 46.0%

    Join Date
    Nov 2006
    Location
    Malaysia
    Posts
    9,802
    Liked
    1656 times
    Points
    48,740
    No problem at all. In fact I'm treating this as a challenge to myself and I get to learn a lot through the process.

    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.
    There is a Startup folder at the Start Menu for Current User and All Users which has been around since Windows 95. However, Shutdown folder was never there and this is the first time that I read you can manually create it to work which did not work when I tested it.

    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...?
    It is possible to run multiple commands through a shortcut using the | vertical bar character. An example of a shortcut location that points to:

    "C:\documents and settings\raymond\desktop\setvol.exe" | shutdown -s -t 0

    The above command run will setvol.exe and followed by instantly (0 seconds) shutting down the Windows system. Take note of the double quotes that must be used if the path contains a space. You can use the shutdown command by itself without specifying the full path because by default Windows has a few environmental variables defined. Yes, unfortunately you will need 3 separate shortcuts for shutdown, restart and logoff

    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.
    I believe the program uses hook to monitor for the internal Windows shutdown command which allows it to run the cleanup before Windows gets shut down. It is probably the same method used in Last Chance.

  2. #12
    Est Moi
    Overall activity: 35.0%

    Join Date
    May 2010
    Location
    Here
    Posts
    535
    Liked
    293 times
    Points
    6,554
    Thank you.

    It is interesting what you can learn as very often the question you start with can lead in many different directions and rarely can one person see all of them.
    You often finish up learning things that go beyond what you originally had in mind. At least I do.

  3. #13
    Experienced User
    Overall activity: 4.0%

    Join Date
    Jun 2009
    Posts
    210
    Liked
    38 times
    Points
    5,122
    I have seen people using Windows scheduler to run batch files at desired time.
    One day, you'll be just a memory for some people. Do your best to be a good one.

  4. #14
    Est Moi
    Overall activity: 35.0%

    Join Date
    May 2010
    Location
    Here
    Posts
    535
    Liked
    293 times
    Points
    6,554
    Quote Originally Posted by Networx View Post
    I have seen people using Windows scheduler to run batch files at desired time.
    That would only work if you used it at set times.

 

 
Page 2 of 2 FirstFirst 12
All times are GMT +8. The time now is 01:11 AM.