Announcement

Collapse
No announcement yet.

Web display of picture with changing filename

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Something to try: make both of the below files using notepad and save on the desktop. Then double click the geturl-t.bat file. A current webcamxp pix should be downloaded, with one copy being saved with a time stamp name, and the other as latest.jpg. Double click the geturl-t.bat file again, and another current pix should be saved with a time stamp name, and the latest.jpg will be over written with the new pix. You could have some event run the geturl-t.bat file to capture the action.

    geturl.vbs
    Code:
    Set objArgs = WScript.Arguments
    url = objArgs(0)
    pix = objArgs(1)
    With CreateObject("MSXML2.XMLHTTP")
     .open "GET", url, False
     .send
     a = .ResponseBody
     End With
     With CreateObject("ADODB.Stream")
     .Type = 1 'adTypeBinary
     .Mode = 3 'adModeReadWrite
     .Open
     .Write a
     .SaveToFile pix, 2 'adSaveCreateOverwrite
     .Close
     End With
    geturl-t.bat
    Code:
    @echo off
    start /w geturl.vbs http://65.80.200.95:8080/cam_1.jpg test.jpg
    copy test.jpg latest.jpg
    SET tnow=%time%
    SET dnow=%date%
    SET hh=%tnow:~0,2%
    SET nn=%tnow:~3,2%
    SET ss=%tnow:~6,2%
    SET ms=%tnow:~9,2%
    SET wd=%dnow:~0,3%
    SET mo=%dnow:~4,2%
    SET da=%dnow:~7,2%
    SET yr=%dnow:~10,4%
    SET pixtime=%hh%h-%nn%m-%ss%s-%ms%ms-%wd%-%mo%-%da%-%yr%
    rename test.jpg %pixtime%.jpg
    cls
    Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

    Comment

    Working...
    X