Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

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

Legacy Cumulus 1 release 1.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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

can a dos script be created to do this??

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: can a dos script be created to do this??

Post by ace2 »

I shall stay awake to the wee hours after work testing this...

Thank you
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: can a dos script be created to do this??

Post by ace2 »

I was so hoping you nailed it, but sorry it doesn't work right, it doesn't seem to be getting the file name, instead taking the am/pm as name..

I have included a fullscreen shot of dir /a-D /tC + creation/modified with what the output is(zero copied as well)

Image

Your going to have to start charging me for your time!!!
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: can a dos script be created to do this??

Post by mcrossley »

My mistake, I did say it was untested. I forgot when I added the extra token for am/pm to increment the variable names...(typed on my phone this time!)

Code: Select all

@echo off
setlocal enabledelayedexpansion
rem get the filename and creation time
rem output: dd/mm/yyyy hh:mm AM|PM    9,999,999 FILENAME.EXT
for /f "tokens=2,3,5 skip=5" %%a in ('dir "E:\snap\*.jpg" /a-D /tC') do (
  rem now split the time, and get the hour
  for /f "tokens=1 delims=:" %%h in ("%%a") do (
    echo checking file: %%c time: %%a hour: %%h  am/pm: %%b
    rem is the file creation am or pm
    if /i %%b==AM (
      rem compare the morning hour
      if %%h==06 copy E:\snap\%%c E:\output1\%%c
      if %%h==07 copy E:\snap\%%c E:\output1\%%c
      if %%h==08 copy E:\snap\%%c E:\output1\%%c
      if %%h==09 copy E:\snap\%%c E:\output2\%%c
      if %%h==10 copy E:\snap\%%c E:\output2\%%c
      if %%h==11 copy E:\snap\%%c E:\output2\%%c
    ) else (
      rem compare the afternoon hour
      if %%h==12 copy E:\snap\%%c E:\output3\%%c
      if %%h==01 copy E:\snap\%%c E:\output3\%%c
      if %%h==02 copy E:\snap\%%c E:\output3\%%c
      if %%h==03 copy E:\snap\%%c E:\output3\%%c
      if %%h==04 copy E:\snap\%%c E:\output4\%%c
      if %%h==05 copy E:\snap\%%c E:\output4\%%c
      if %%h==06 copy E:\snap\%%c E:\output4\%%c
    )
  )
)
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: can a dos script be created to do this??

Post by ace2 »

just a long shot, is there anyway of using the date modified instead of the creation date??

It shouldn't matter too much as the creation date won't be altered, but this fails if i say move them to another location...

It doesn't matter if it can't be done..

My plans for this script are to create time lapse videos say of the last hour or 2..

Eg.

9am run script to copy jpg's 6 to 8am and convert to mp4, then at 10am to copy 8am to 9am and so on over writing the mp4
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: can a dos script be created to do this??

Post by ace2 »

and I can't test if its fully functioning until after 6am cause all my jpg's have been copied to another folder so script will see it as creation date..
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: can a dos script be created to do this??

Post by mcrossley »

Change /tC to /tW to get the last modified time
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: can a dos script be created to do this??

Post by ace2 »

:clap: :clap: 110% working :clap: :clap:

you're a genius!!!!!!!

Thanks for your skills with this script. Now to write up the full script.................
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: can a dos script be created to do this??

Post by ace2 »

Ok, been playing around with this script and have put something together.

I've added it to my webcam page to upload every hour the last 2 hours on the hour in a time lapse format mp4.
It's up and running between the hours of 5am - 8pm(ACST)

At the moment i have the Mp4 opening in a new browser window.

So your script is a success....... :clap:

Next project, overlay weather information with scripting.......................But that's another story.............

So once again, thank you thank you....

Edit: its now opening in a another page, didn't like the mp4 opening in a separate window on it own.
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
Post Reply