Audio/video stream recording forums
|
Attention Visitor: |
You may have to register or log in before you can post:
|
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
[SOLVED]How to download files with timestamp in filename (Windows).Hi
With Linux I can use a command like this:- Code:
NOW=$(date +"%Y-%m-%d-%H-%M"); vlc --run-time=30 http://stream-sd.radioparadise.com:9000/rp_192.ogg --sout "#std{access=file,mux=ogg,dst=$NOW-RadioParadise.ogg}" vlc://quit What is the syntax when using Windows from cmd or with a bat script to give the file a name with the timestamp in the filename? Last edited by bat999 : 12-17-2011 at 08:43 PM. |
#2
|
|||
|
|||
Re: How to download files with timestamp in filename (Windows). |
#3
|
|||
|
|||
Re: How to download files with timestamp in filename (Windows).This command:-
Code:
for /f "tokens=1-6 delims=/:." %a in ("%date%.%time%") do set FileName="%c-%b-%a-%d-%e-RadioParadise.ogg" && "C:\Program Files\VideoLAN\VLC\vlc.exe" --run-time=30 http://stream-sd.radioparadise.com:9000/rp_192.ogg --sout "#std{access=file,mux=ogg,dst=%FileName%}" |
#4
|
|||
|
|||
Re: [NOT SOLVED]How to download files with timestamp in filename (Windows).Hi
I think there's a problem when using this method with Windows. When the hour is a single digit (1am) it is trying to create a filename with a space in it. Like this:- 2011-12-19- 1-45-RadioParadise.ogg Maybe something is needed to pad the hour out to 2 digits ("01" instead of " 1"). Perhaps this applies to month and date too. (With the Linux command it seems to pad out the hour to 2 digits automatically). |
#5
|
|||
|
|||
Re: [SOLVED]How to download files with timestamp in filename (Windows).actually it's little dependent on your system's time display settings. for example the command
Code:
echo %date%.%time% Code:
Mon 19/12/2011. 9:43:13.76 the following adjusted command outputs the filename from the above data in the format you want. Code:
for /f "tokens=2-7 delims=/:., " %a in ("%date%.%time%") do set FileName="MyShow_%a-%b-%c_%d-%e-%f.flv" Code:
set FileName="MyShow_19-12-2011_9-53-15.flv" |
#6
|
|||
|
|||
Re: [SOLVED]How to download files with timestamp in filename (Windows).It gives a different result on this Windows XP box.
Code:
echo %date%.%time% 19/12/2011. 5:01:32.84 Code:
set FileName="MyShow_12-2011-5_02-13-46.flv" I would like a solution that is OK for all Windows systems, whatever the settings. |
Tags: filename, timestamp, windows |
Thread Tools | |
Display Modes | |
|
|