DOS/batch file question - Microsoft Windows

This is a discussion on DOS/batch file question - Microsoft Windows ; I'd like to use variables in a batch file to create another file that's named: YYYY-MM-DD-filename.txt right now, I have program.exe > filename.txt What variables do I use to get the date in the file name? Gwen -- When love ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: DOS/batch file question

  1. DOS/batch file question

    I'd like to use variables in a batch file to create another file
    that's named: YYYY-MM-DD-filename.txt

    right now, I have
    program.exe > filename.txt

    What variables do I use to get the date in the file name?

    Gwen

    --
    When love is gone, there's always justice.
    And when justice is gone, there's always force.
    And when force is gone, there's always Mom.
    Hi, Mom! -- Laurie Anderson

  2. Re: DOS/batch file question

    Gwen: An example from: http://www.robvanderwoude.com/datetiment.html

    @ECHO OFF
    FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET DATE=%%B
    ECHO It's %DATE% today
    REM
    REM erase the DATE envirment variable
    SET DATE=

    Skip

    On Thu, 18 May 2006 21:46:20 -0400, Gwen Morse wrote:

    -|I'd like to use variables in a batch file to create another file
    -|that's named: YYYY-MM-DD-filename.txt
    -|
    -|right now, I have
    -|program.exe > filename.txt
    -|
    -|What variables do I use to get the date in the file name?
    -|
    -|Gwen


+ Reply to Thread