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

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

PCNS Command File

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.

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 Data Center & Enterprise Solutions Forum
  • PCNS Command File
Options
  • 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
5060
voidstar_apc
Janeway voidstar_apc
196
Teken
Spock Teken
114
Erasmus_apc
Sisko Erasmus_apc
112
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 Data Center & Enterprise Solutions Forum
Solved
Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:51 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

0 Likes
13
3772
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:51 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

PCNS Command File

I have a question regarding PCNS and the Run Command File setting.

I can correctly run a command when the Communication: Established event is fired. My problem is that the same command will not run when it is set under the UPS: On Battery event. We've tried to test it by setting the event length to a low value, like 10 second, then unplugging the UPS, but the command never runs. What am I missing?

Additional information: We've tried different scripts, including simple .bat scripts. I'm not wanting to actually shut down the system when it is on battery, just run the command, so that's why we are trying to configure the Run Command File setting when on battery. The NMC are on the latest version and it is PCNS version 2.2.4. This is on Windows 2008 R2.

Labels
  • Labels:
  • UPS Management Devices & PowerChute Software
Reply
Contact Support

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

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:48 AM

0 Likes
0
3772
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:48 AM

I have finally got it to work. Don't know if what I was trying earlier wasn't supported or not, but I at least have it working the way that I want.

My previous installation was for a single installation but monitoring multiple ups devices.

When I reinstalled using a double installation and each one of those monitoring a single ups, the commands worked correctly for an on battery event.

See Answer In Context

Reply
Contact Support

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

Replies 13
Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:51 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:51 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

I have a question regarding PCNS and the Run Command File setting.

I can correctly run a command when the Communication: Established event is fired. My problem is that the same command will not run when it is set under the UPS: On Battery event. We've tried to test it by setting the event length to a low value, like 10 second, then unplugging the UPS, but the command never runs. What am I missing?

Additional information: We've tried different scripts, including simple .bat scripts. I'm not wanting to actually shut down the system when it is on battery, just run the command, so that's why we are trying to configure the Run Command File setting when on battery. The NMC are on the latest version and it is PCNS version 2.2.4. This is on Windows 2008 R2.

Reply
Contact Support

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

BillP
Administrator BillP Administrator
Administrator

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

i would start by [looking at this thread|https://community.se.com/t5/EcoStruxure-IT-forum/bd-p/ecostruxure-it-forum] and verifying everything that we went over with the original poster.

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

I have reviewed the post by winna and made sure to try everything in it.

I've setup a test.cmd script that has the following syntax to keep it as simple as possible, ver > c:\test.txt.

I then put the "c:\test.cmd" into the Run a Command File on event Communication Established and also in the On Battery event. I then unplugged/plugged the ethernet cable from the NMC to create a communications established event. This successfully created a test.txt file on the root of the drive. I then unplugged the UPS from power to create an On Battery event. This did not ever create a test.txt file.

I've included screenshots to show that the events did get logged in PCNS and also to show that the file was created only once. I've attempted this with the PCNS service running both as system (allowed to interact with the desktop) and also as the local admin account. Both had the same results.

I just find it weird that it works on one event and not the other. There should be no difference between the two.

Attachments
Reply
Contact Support

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

BillP
Administrator BillP Administrator
Administrator

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:57 AM

Can you browse on the directory where you installed PCNS? The default installation folder is C:\Program Files\APC\PowerChute\group1. Once you are on that folder can you check if there is a file that says cmdfile.log. If you do you can open it up using NotePad and it should contain an error message on what went wrong.

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

This is the only thing that the cmdfile.log file contains.

[Tue Nov 02 09:13:53 CDT 2010] -
[Tue Nov 02 09:13:53 CDT 2010] - C:\Program Files (x86)\APC\PowerChute\group1>ver 1>c:\test.txt
[Tue Nov 02 09:13:53 CDT 2010] -
[Tue Nov 02 09:13:53 CDT 2010] - C:\Program Files (x86)\APC\PowerChute\group1>exit

Do the different events interpret the command files differently?

Reply
Contact Support

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

BillP
Administrator BillP Administrator
Administrator

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

Based from my experience, PCNS can only execute a single line command file. If you need to call a multi-line command file you might want to create a single line command file and call the multi-line command file from there. The logs shows that both commands on the command file failed to execute, I am basing it from my experience. Please see Winna's post, it has the link on my experiment.

Also I suggest that you check this APC Knowledge Base [A command file is not running within PowerChute Network Shutdown|http://nam-en.apc.com/app/answers/detail/a_id/2441/kw/pcns%20command%20file]. This should give you an idea with regards to command file.

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

So the two events are handled differently then since I can get it to work in one event, but not the battery event?

I am experimenting now with the single line command calling another command file.

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

When running a command file off of the on battery event, it only looks at the time in the event configuration correct? It does not care about run times right because it is not part of the shutdown command?

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

For more information, I have just confirmed that the cmdfile.log file is created even when the command file runs successfully on the communications established event.

So we are still left with the same issue. The communications established event is not operating the same as the on battery event.

I have also installed PCNS onto two other computers with the same results. One being XP and the other Win Server 2003 x64.

Message was edited by: jjb80

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

I was out of the office today and will test this tomorrow when I get back in. I appreciate the additional ideas to test. Thank you.

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

Just tested it today with only one event configured to run a command file, that being the on battery event. Unfortunately it did not run the command when the ups was unplugged, and there was no cmdfile.log file generated to tell me any errors. It did log the on battery event in the PCNS log though. So it seen that the ups was unplugged.

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:56 AM

You are thinking along the same lines that I already did. ๐Ÿ™‚

Based on the previous post about PCNS only liking single line command files, I have two files setup for my testing. The first one, test1.cmd is the one that I call from the event. This file just calls the second test file, test.cmd, which contains the ver > c:\test.txt and then an exit command. I have tried appending the file and overwriting it. When I get a successful test on the communications established event, I make sure to delete the test.txt file to make sure I know it ran. I have also tried taking out the exit, so that I can look in the task manager to see if the conhost process is still running. I have also tried to run only the test.cmd file, but it results in the same action.

All of that occurring is still what makes me think that PCNS is not actually firing off the command in the on battery event.

I have not tried the threading issue that you suggested on another computer. I'll try that tomorrow.

Reply
Contact Support

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

Anonymous user
Not applicable

Posted: โ€Ž2021-06-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:48 AM

0 Likes
0
3773
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • 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-30 07:52 PM . Last Modified: โ€Ž2024-03-07 01:48 AM

I have finally got it to work. Don't know if what I was trying earlier wasn't supported or not, but I at least have it working the way that I want.

My previous installation was for a single installation but monitoring multiple ups devices.

When I reinstalled using a double installation and each one of those monitoring a single ups, the commands worked correctly for an on battery event.

Reply
Contact Support

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