I'm having a moment, can you help? :-)
I just want to set up a .bat file in my windows box to take a log file, rename it with a date/timestamp and then move /copy it off to another
dir.
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"
:) Sorry, outta my league.
I don't actually know anything about batch scripting on windows. I'm a unix guy through and through, and that whole script could be replaced
with a one-liner in linux:
Heh... yeah me too I'm going to seek wider help in another echo. What I supplied I sourced from the net and it's not working as expected but
then I think that's because there are differing versions of DOS :-(
Fun times for a Saturday night!
Success it's %date:~-4,4%-%date:~-7,2%-%date:~-10,2%-filename.txt
The :~ substring command works like this:
:~[START POS],[LENGTH]
What are you doing at home? You should have been HAMming it up at Shag Valley! ;)
Cool! That's a lot less convoluted. haha
The :~ substring command works like this:
:~[START POS],[LENGTH]
That's a good one to know.
Heh, yep.... I have kids at learn to sail classes on Sunday morning so based at home this weekend. Still I can give it a push on Fido. I'm getting a lot of emails coming into the webmaster account on zl4aa.org from a bunch of HAM operators making contact with the station - really cool.
Always a good feeling when you suss a problem. That and getting your
.bat to do what it should!
Sysop: | Nelgin |
---|---|
Location: | Plano, TX |
Users: | 417 |
Nodes: | 10 (1 / 9) |
Uptime: | 46:50:21 |
Calls: | 6,204 |
Calls today: | 19 |
Files: | 15,733 |
Messages: | 753,368 |
Posted today: | 3 |