Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Powerchute Personal Edition - Run external commands with this utility

APC UPS for Home and Office Forum

Support forum to share knowledge about installation and configuration of APC offers including Home Office UPS, Surge Protectors, UTS, software and services.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forΒ 
ShowΒ Β onlyΒ  | Search instead forΒ 
Did you mean:Β 
  • Home
  • Schneider Electric Community
  • APC UPS, Critical Power, Cooling and Racks
  • APC UPS for Home and Office Forum
  • Powerchute Personal Edition - Run external commands with this utility
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
BillP
Administrator BillP Administrator
2151
Teken
Janeway Teken
99
voidstar_apc
Janeway voidstar_apc
83
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to APC UPS for Home and Office Forum
Solved
Anonymous user
Not applicable

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:14 AM

0 Likes
14
4990
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:14 AM

Powerchute Personal Edition - Run external commands with this utility

Hi all,

I guess there are a few of us in the same boat here, With BackUPS's and the Powerchute Personal Edition, and wanting to run an external command just before the system hibernates or shuts down, ie to send an email or shutdown VM's

Well, I have written a small utility that intercepts the shutdown / hibernate commands from the Powerchute application and this allows you to run an external command, as well as setting a delay before the system resumes the hibernate / shutdown procedure as it would normally

This utility was written and tested with Powerchute Personal Edition ver 3.0.0.1 on Windows 7

To install:

1) Navigate to your Powerchute folder - ie "C:\Program Files\APC\PowerChute Personal Edition"
2) Rename the existing apcrun.exe to apcrun1.exe
3) Download the attached zip file and extract to your Powerchute folder, ie "C:\Program Files\APC\PowerChute Personal Edition"
4) Edit the included APC_CMDExecutor.ini file and set the actions to take

Settings
HibernateCommand = "C:\tempunthis.bat"
ShutdownCommand = "C:\tempunthis.bat"
HibernateDelay = 8
ShutdownDelay = 8
Debug = 0

If your system has hibernate enabled, then set your external command in the hibernate command field,
Otherwise if your system shuts down instead of hibernating then set your external command in the shutdown command field.

The delays will delay the shutdown or hibernate commands being sent to the system for X seconds, this is to allow your custom command above to execute fully before continuing with the shutdown

The debug field will pop up a box showing what command was piped by powerchute, for normal operation leave this = 0

The program is provided as is with no warranties and at your own risk, I will not be responsible for any damage caused to your system or software by using this app.

To test your custom external command:
Start - run
cmd
cd "C:\Program Files\APC\PowerChute Personal Edition"
apcrun Local\IDD_HIBER_WARNING - to test the hibernate command -OR-
apcrun Local\IDD_SHUTDOWN_WARNING_XP -to test the shutdown command

Attachments
APC_CMDExecutor.zip
Labels
  • Labels:
  • Back-UPS & Surge Protectors
  • Tags:
  • apc
  • application
  • back-ups
  • backups
  • command
  • cs
  • external
  • PowerChute
  • program
  • run
  • software
  • windows
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
BillP
Administrator BillP Administrator
Administrator

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4985
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

Hi Dana,

When PowerChute Personal Edition is installed it enable hibernation in the OS. You have the shutdown options within PowerChute to keep the computer on as long as possible or preserve battery power. Keep computer on as long as possible with keep the computer running until the battery has x minutes left of life and then the OS will be commanded down. preserve battery power will command the OS down after running on battery for a set period of time. Depending on which setting you select (the default is preserve battery power) when the threshold is reached the OS will be commanded down and the system will hibernate. 

NOTE: If you do not want the system to hibernate the setting can be disable by opening a command prompt as an admin and entering powercfg.exe /hibernate off. If hibernation is off the OS will shutdown same as selecting shut down from the run menu. 

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 14
Anonymous user
Not applicable

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:14 AM

0 Likes
0
4986
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:14 AM

Hello.

Can you pelase Upload the File again? When i want to open it it says it's corrupt

Thanks a lot!!!

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4986
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:13 AM

Can you upload your attachment again. I try to open it and it says its corrupt.

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4986
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 06:59 AM . Last Modified: β€Ž2024-03-21 05:13 AM

Thanks for posting this.

I gave it a try on a Win 7 x64 box.. Unfortunately, was not successful.. It would launch the executable, throw up the dialog box indicating that it was launching my script, but my script never launched, and the hibernate delay settings never took hold. It kicked off the hibernation process and the delay was always 10 sec, not the 60 sec I specified in the .ini file.

Thinking it might be a path issue (Program Files x86) vs Program Files, I took your files and copied them to the Program Files folder for giggles.. No difference

Any suggestions appreciated

Thanks, Jim

Reply

Link copied. Please paste this link to share this article on your social media post.

amd.64_apc
Crewman amd.64_apc
Crewman

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4987
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

What I would like is to get an email if the server has been running on battery for 5 minutes. Is this possible?

Reply

Link copied. Please paste this link to share this article on your social media post.

BillP
Administrator BillP Administrator
Administrator

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4987
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

amd.64,

If you are going to use PCPE to achieve that, it is not possible. You might need to create an extensive script to do that.

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4987
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

Thanks PCS! I tried your program on a Windows Server 2008 and it works like a charm!
I actually registered in this forum just to thank you!

I had placed the apcrun.exe in the folder:
C:\Program Files (x86)\APC\PowerChute Personal Edition

My APC_CMDExecutor.ini file:
[Settings]
HibernateCommand = "D:\PowerMonitor\shutdown.bat"
ShutdownCommand = "D:\PowerMonitor\shutdown.bat"
HibernateDelay = 300
ShutdownDelay = 300
Debug = 0

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4987
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

This would be great, but doesn't seem to work on Win8 Pro. At least, not when I'm logged-in via a Remote Desktop session. 😞

Reply

Link copied. Please paste this link to share this article on your social media post.

BillP
Administrator BillP Administrator
Administrator

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4987
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

Thnaks! tried from WIndows 2003 Server and works OK (at least from within a session, just waiting for a real powert outage to test if it will run from powerchute itself!)

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4987
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

I had the same problem as ltpolaris, I'm runnning Windows 7 64-bits, and your app pops up saying it's running my script, but somehow the script doesn't really execute...

But I found a solution that really solves my problem:

http://www.apcupsd.com

Reply

Link copied. Please paste this link to share this article on your social media post.

dr1rrb_apc
dr1rrb_apc
Cadet

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4987
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

I found an easy solution which does not require any external software! My solution does not perfectlly match the original problem, but when I was searching to my problem I found this thread which drives me to the right solution.

For info, my config is Win Server 2012 R2 with the Hyper-V role installed and I use PCPE 3.0.2. My goal is to keep my server running some few minutes and then gracefully power it down. As I've Hyper-V installed I cannot enable the "Hibernation", and PCPE will turn off power instead of gracefully switching off my computer.

  1. Configure PowerChute to "Keep my computer on as long as possible" (the idea is to turn the computer off before PCPE try to do it)
  2. Open task scheduler and create a task executed on power blackout:
    • Trigger:
      • Event
      • Event log: Application
      • Source: "APC UPS Service"
      • Event ID: 174
    • Action: Whatever you want! In my case:
      • Program: C:\Windows\System32\shutdown.exe
      • Parameters: /s /f /t 120 /c "Auto shutdown due to power failure." /d 6:12
  3. Create a second task to abort shutdown if power is restored:
    • Trigger:
      • Event / Application / "APC UPS Service" / 61455
    • Action:
      • Program: C:\Windows\System32\shutdown.exe
      • Parameters: /a
  4. Unplug your UPS to test ! πŸ˜‰

The great thing with this solution is that you can also easily send email (http://caspian.dotconf.net/menu/Software/SendEmail/) after 5 minutes on battery if you want.

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4986
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

I just wanted to say I've left my computer unplugged from my APC since I first got the UPS because I was told by support there was no way to keep the battery providing power after the PC shuts down if its connected via USB. 

I haven't been able to get the graceful shutdown or access to battery stats.  Either that or I have to leave the PC on and let it drain the power quickly.  My goal was to quickly power down my computer and leave the remaining juice to power my network.  

Support and many sites said this was not possible which seems like a God awful HUGE oversight in the software design. 

Anyways I used your method in task scheduler to power down my computer and everything else stayed running so I'm very happy with those results.  Thank you. 

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4986
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

Thank you David. You are the MAN!

Reply

Link copied. Please paste this link to share this article on your social media post.

BillP
Administrator BillP Administrator
Administrator

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4986
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

So you're telling me there is NO OFFICIAL way of shutting down the computer?

Reply

Link copied. Please paste this link to share this article on your social media post.

BillP
Administrator BillP Administrator
Administrator

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

0 Likes
0
4986
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2021-06-29 07:00 AM . Last Modified: β€Ž2024-03-21 05:13 AM

Hi Dana,

When PowerChute Personal Edition is installed it enable hibernation in the OS. You have the shutdown options within PowerChute to keep the computer on as long as possible or preserve battery power. Keep computer on as long as possible with keep the computer running until the battery has x minutes left of life and then the OS will be commanded down. preserve battery power will command the OS down after running on battery for a set period of time. Depending on which setting you select (the default is preserve battery power) when the threshold is reached the OS will be commanded down and the system will hibernate. 

NOTE: If you do not want the system to hibernate the setting can be disable by opening a command prompt as an admin and entering powercfg.exe /hibernate off. If hibernation is off the OS will shutdown same as selecting shut down from the run menu. 

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

Β 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings Β© 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of