APC UPS Data Center & Enterprise Solutions Forum
Schneider, APC support forum to share knowledge about installation and configuration for Data Center and Business Power UPSs, Accessories, Software, Services.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-09-27 01:35 AM
Hi guys, I am working for an automation solution to trigger whenever bad event occurs (battery disconnected, power fail etc..). I am trying to utilize cmdfiles in powerchute package to run another .exe.
I try to build .exe in both python and C#, and can run perfectly when i click to run cmdfiles. The web app interface can actually trigger to run cmdfiles ( i check by log as described above); however, the GUI of .exe app can not open, and this is the key warning to automatically warning abnormalities of UPS.
Here is my cmdfiles, i try to enable 1 by 1 already but still the same:
@echo off
rem
rem Maximize for best viewing
rem This command file provides examples of proper command file syntax
rem
rem Command Files run by PowerChute Business Edition must be placed in this directory.
rem
rem Use the full path name of executable programs and external command files.
rem
rem The @START command must be used to run executable programs (see example below).
rem For the @START command, path names that include spaces must be enclosed in quotes;
rem arguments for the executable must be outside the quotes. A double quote must
rem precede the quoted path name. For example, to execute a command file in
rem c:\Program Files\APC\PowerChute Business Edition\agent\cmdfiles called myShut.exe,
rem the following line should be entered in the command file:
rem
rem @START "" "c:\Program Files\APC\PowerChute Business Edition\agent\cmdfiles\myShut.exe"
rem
@START "" "C:\Temp\UPS\UPS_Doctor.appref-ms"
rem @START "" "C:\Temp\LCBI\UPS\Warning_UPS.exe"
@echo on
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-09-27 05:32 PM
Very appreciate mrBIllP,
I just wonder can i utilize CMD windows as an GUI, and perhaps cmdfiles of Powerchute can pop .bat up on the desktop screen. I work on a factory 24/7 so it is convenient if i can make some noticeable trigger on the screen for operator to execute.
Could u be so kind as to instruct me workaround solution of this, if windows of .bat still cannot show up on desktop screen.
Many thanks,
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-09-27 05:34 PM
thanks mr BillP. Can I utilize .bat to pop up cmd window on desktop screen?
If not, please advise me a workaround solution, i really need to show it up on screen as an alarm alerting.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-09-28 12:25 PM . Last Modified: 2023-09-28 12:50 PM
When an event is logged by PowerChute Business Edition or PowerChute Serial Shutdown, an entry is added to Event Viewer - Windows Logs - Applications. Create a task for the event. The task can be configured to run a .exe.
Another option is to have PowerChute trigger a batch file, and the batch file will run a PowerShell script. With PowerShell, you can script almost all functions on a Windows system.
For a popup message, you could run msg.exe if it is available on the system.
For a list of events, log in to the Event Viewer, see Schneider Electric FAQ FA228995.
Link copied. Please paste this link to share this article on your social media post.
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.