Community discussions

MikroTik App
 
eldoncito2019
Member
Member
Topic Author
Posts: 332
Joined: Fri Jun 14, 2019 1:07 pm

Drag file to desktop.

Sat Jun 18, 2022 4:31 pm

Friends,
I have this script that my friend REXTENDED made for me:
:delay 10s

:global arrMonths {jan="01";feb="02";mar="03";apr="04";may="05";jun="06";jul="07";aug="08";sep="09";oct="10";nov="11";dec="12"}
:global stopRouterRun false

/system clock
:local data       [get date]
:local year       [:pick $data 7 11]
:local month      ($arrMonths->[:pick $data 0 3])
:local day        [:pick $data 4 6]
:local file       "electric-cut_$year-$month-$day_$[get time].txt"

:do {
    /system clock
    :local data   [get date]
    :local year   [:pick $data 7 11]
    :local month  ($arrMonths->[:pick $data 0 3])
    :local day    [:pick $data 4 6]
    :local date   "$day-$month-$year"
    :local itime  [get time]
    :local hours  [:pick $itime 0 2]
    :local minsec [:pick $itime 2 8]
    :local mhours [:tonum $hours]
    :local msymbl "AM"
    :if ($mhours > 11) do={:set msymbl "PM"}
    :set mhours ($mhours % 12)
    :if ($mhours =  0) do={:set mhours 12}
    :if ($mhours < 10) do={:set mhours "0$mhours"}
    :local mtime "$mhours:$minsec $msymbl"
    :local data1 "****************************\r\n      COURT:$date\r\n     AT: $mtime\r\n****************************"
    /file
    :if ([:len [find where name=$file]] = 0) do={print file=$file; :delay 5; set $file contents=""}
    set $file contents=$data1

    :delay 60s
} while=(!$stopRouterRun)

But why can't I drag it from the file section to the desktop of my pc, and the other files if I can, can someone help me?



EL DONCITO.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Drag file to desktop.  [SOLVED]

Sun Jun 19, 2022 3:43 am

because windows do not accept : (and \ / * ? " < > | ) on file name...

replace this:
:local file       "electric-cut_$year-$month-$day_$[get time].txt"

with thist:
:local time       [get time]
:local hours      [:pick $time 0 2]
:local minutes    [:pick $time 3 5]
:local file       "electric-cut_$year-$month-$day_$hours-$minutes.txt"

Who is online

Users browsing this forum: mbezuidenhout and 19 guests