Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

External Programs - Parameters

Topics about the Beta trials up to Build 3043, the last build by Cumulus's founder Steve Loft. It was by this time way out of Beta but Steve wanted to keep it that way until he made a decision on his and Cumulus's future.

Moderator: mcrossley

Locked
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

External Programs - Parameters

Post by BCJKiwi »

With Cumulus1 I used batch files in external programs for a number of purposes.

I have refined this activity for MX as batch (.cmd) files open a live windows command shell taking focus from whatever you may be doing.
I still have one .cmd file, daily.cmd which;
runs an FTP program to send dayfile.txt to the public website,
copies dayfile.txt to the LAN webserver,
copies (with date selection) NOAA files to the LAN webserver.

Am testing two solutions to run daily.cmd hidden;
1. vbs

Code: Select all

 ' daily.vbs
' Runs daily.cmd in a new hidden command shell ( the '0' ).
' references - https://msdn.microsoft.com/en-us/library/d5fk67ky.aspx
' Note, if there is a pause or other 'feature' which stops the execution of the .cmd file,
'       the hidden shell will be left running but doing nothing.
'       Use Task manager to close it.

' invoke shell . Run "this command", hide, wait for command to finish then close hidden shell
CreateObject("Wscript.Shell").Run "C:\CumulusMX\FTP\daily.cmd", 0, True
Wscript.Quit
This seems to work OK with full_path_to/daily.vbs in the external programs slot - no parameters required.
2. chp.exe This is a small program available here http://www.commandline.co.uk/chp/ you only need the chp.exe program from the download package. This works great from the command line with chp.exe in the same folder as daily.cmd. This also will be left hanging if the batch file fails to complete.
However I am unable to work out how to get this working in the external programs slot(s).
The command line that works is;
full_path_to/chp.exe daily.cmd where chp.exe and daily.cmd are in the same folder.

Both these approaches have the advantage that the daily.cmd file can be run directly if required.

As it takes a day for each alternative in external files to be tested properly any assistance in how external files/parameters work would be much appreciated.
Last edited by BCJKiwi on Sat 02 May 2015 9:42 pm, edited 1 time in total.
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: External Programs - Parameters

Post by steve »

"full_path_to/chp.exe" is the command and "daily.cmd" is the parameter - does that not work?
Steve
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: External Programs - Parameters

Post by BCJKiwi »

Thanks,
"full_path_to/chp.exe" is the command and "daily.cmd" is the parameter
That is what I expected but it did not work last night.
I will try it tonight with the full path to daily.cmd as well. I presume the quotes are not required? They are not when just calling daily.cmd directly nor when calling daily.vbs.
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: External Programs - Parameters

Post by steve »

It looks like I am actually causing the window to be opened when the command is run, and I can change it so that (in theory at least) it doesn't do that. That would make things simpler.
Steve
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: External Programs - Parameters

Post by BCJKiwi »

Yes, that would be preferable to running extra 'hide me' tricks.

I can confirm that the chp.exe and daily.cmd combo with full path for each (no quotes) has just run as expected.

So, if you don't/can't make the external programs run without launching a new command shell, then we will have two options for doing it hidden (vbs and chp) as outlined in the first post.

Thanks
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: External Programs - Parameters

Post by BCJKiwi »

Have updated the .vbs script in the first post by adding
Wscript.Quit
on a new line at the end.

Found there were cmd and wscript left running in task manager.
Wscript.Quit appears to have stopped that.
Locked