Jump to content

Configure Start-ShutDown to perform a batch file execution


nsan3

Recommended Posts

Hi,

My laptop is not retaining battery even when I shut it down at 100%.

After 6-days, when I switch it back on, the battery level is at 30%, yeah I know.

So I wanted to know if I can configure the Start Menu->ShutDown option to run a batch file (or) run a Shorcut.

I intend to have the command in it -> shutdown /s /f /t 0

Thanks in advance.

Link to comment
Share on other sites


  • Replies 17
  • Views 2.6k
  • Created
  • Last Reply

Are you putting the laptop to 'Sleep" instead of powering off possibly ?

 

If you are not putting the laptop to sleep, and as you say it's not retaining charge, I would be more inclined to believe your battery or charger is at fault, how old is the battery, have you tried a different charger, have you re-calibrated the battery.

 

It is pointless to run a batch file to force a shutdown with 0 delay, your are more likely to cause some software / registry corruption.

Link to comment
Share on other sites


Thanks @Dodel, the battery is just 6-month old, have checked the charger, its working well. I did re-calibrate the battery recently.

One of the IT guys at my workplace told me to maybe try the complete-shutdown method and see how it goes.

But yes, am looking for more opinions from here.

Link to comment
Share on other sites


Hi!

First, to run any Batch file before shutting down your computer, you can simply start it with the START command from another Batch file, to which you add the shutdown /s /f /t 0 command at the end.

And to do the same thing at Windows startup, you can copy the shortcut (or the one in your batch file) that you want to execute to the shell:startup folder.

EDIT: I'm sorry I didn't express myself well. I hope this will help you.

 

Best regards

Link to comment
Share on other sites


1 hour ago, Tux 528 said:

Hi!

First of all, to shut down your computer, you can simply write the commands from the batch file in question to another batch file, where you add at the end the shutdown /s /f /t 0 command.
Then, you can copy the shortcut (or the one of your batch file) to the shell:startup folder so that it will be launched at Windows startup.

I hope this will help you.

Best regards

So when I place the Shutdown batch file to the shell:startup folder, wouldn't my system just shut-down right after start-up?

Am I mistaken or did you mean to say something else here?

Link to comment
Share on other sites


Check the BIOS/UEFI some have also options for Fast boot or similar, another thing, in some machines its possible to have power on the USB ports to charge a Cell phone for example with the machine power off, some times this can be turned off on BIOS/UEFI if you don't need this feature.

 

 

Link to comment
Share on other sites


Hello,

I'm sorry if I didn't express myself well... :blush2: I've edited my previous message so you can understand it better.

Regards

Link to comment
Share on other sites


10 minutes ago, MrZeb said:

Check the BIOS/UEFI some have also options for Fast boot or similar, another thing, in some machines its possible to have power on the USB ports to charge a Cell phone for example with the machine power off, some times this can be turned off on BIOS/UEFI if you don't need this feature.

In the BIOS, there is a Quick Boot open but it was already Disabled.

The USB Charge option is also Disabled in the BIOS.

6 minutes ago, Tux 528 said:

Hello,

I'm sorry if I didn't express myself well... I've edited my previous message so you can understand it better.

Regards

You do understand that placing files in the shell:startup folder triggers that file to execute at startup right? So what sense that it make to place a Shutdown script there?

I understand you are trying to be helpful but it does not make sense to me.

Thanks.

Link to comment
Share on other sites


We misunderstood each other. Therefore, I'll go back to the beginning. If I understand correctly, you want to configure Windows to run a batch file or shortcut when it starts, or before shutting it down.
So I suggested that you create another batch file that just executes what you want before shutting down your computer.

As far as startup is concerned, I advised you to copy the files / shortcuts to be started at the same time as Windows in the shell:startup folder (so a Batch file or a shortcut, if that's what you want).
If you follow me, the Batch file that shuts down your computer has nothing to do with yours, it doesn't make sense to start Windows and shut it down directly afterwards.

However, it might be simpler if you explain what you want to do before shutting down or restarting your PC so that we know exactly what you want to do. :yes:

Link to comment
Share on other sites


@Tux 528 So what I wanted to say is, do you know the ShutDown option on the Start Menu?

So I want to remap that ShutDown option to run a ShutDown batch file.

Plain and simple. Thanks.

 

PS: Please forget about the Startup, I did not say anything related to startup.

Link to comment
Share on other sites


Okay, I finally figured out what you were talking about. To do this, you need to configure the Local Group Policy Editor to run whatever you want at Windows startup and shutdown. However, this editor is not available on the Home versions of Windows but you can modify the Registry to access it... Then, you can access the startup properties and modify what you want.

Link to comment
Share on other sites


4 minutes ago, Tux 528 said:

Okay, I finally figured out what you were talking about. To do this, you need to configure the local Group Policy Editor to run whatever you want when Windows starts and stops. However, this editor is not available on the Home versions of Windows but you can modify the Registry to access it...
Then, you can access the startup properties and modify what you want.

Thanks, can you explain in a more detailed manner, so I can perform it on my Windows 10 Professional edition.

Link to comment
Share on other sites


Can you let us know what the outcome is after trying the fix, ty.

 

Link to comment
Share on other sites


Well its actually a bit better now, my battery is not draining out as before :cheers:

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...