1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Environment variable to file

Discussion in 'Other PC Software' started by Maxb, 2003/11/23.

Thread Status:
Not open for further replies.
  1. 2003/11/23
    Maxb

    Maxb Inactive Thread Starter

    Joined:
    2002/06/14
    Messages:
    6
    Likes Received:
    0
    I would like to write an environmet variable to a .txt file without a space, carriage return, line feed, or any other characters at the end of the line. The following code writes the variable but adds a cr-lf to the end of the string. echo %var% > text.txt How can I not get the cr-lf?
     
    Maxb,
    #1
  2. 2003/11/24
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    I'm not getting the CR/LF when I try but I am getting the space at the end of the line. Hmmmmm Gotta be a way to supress that.

    What OS? Where are you generating the string from?
     
    Newt,
    #2

  3. to hide this advert.

  4. 2003/11/24
    Maxb

    Maxb Inactive Thread Starter

    Joined:
    2002/06/14
    Messages:
    6
    Likes Received:
    0
    I'm getting the string (variable) from the following ecpression:
    for /f "tokens=2-4 delims=/ " %%a in ('DATE /T') do set Date=%%c%%a%%b
    I'm using WinXP Professional.
     
    Maxb,
    #3
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.