Rename/Copy File with Date Appended.
Results 1 to 7 of 7

Thread: Rename/Copy File with Date Appended.

  1. #1
    Join Date
    Mar 2000
    Location
    Arkadelphia AR
    Posts
    224

    Rename/Copy File with Date Appended.

    Ok, been out of the Dos world too much. I still use Batch files a lot though.

    Heres what I need, this should be simple.

    I want to take a file.. rjcrash.out.sent and rename or copy to
    rjcrash022404.sent

    I want the filename to have the date appended as part of the name.

    I use Windows 2000 and the copy command retains long file names I know.

    Even if I just have to have the file name with 8 digits, the date will do.

    Thanks for the help.
    Rj
    Microsoft keeps my Old mind active. Right when I get one Op System figured out, we get a new one RjCrash
    *******************************

  2. #2
    Join Date
    Apr 2000
    Posts
    1,579
    The information presented in the following link seems to be what you need.
    Please note that I have not tried myself.
    http://www.winnetmag.com/Article/Art...575/13575.html

  3. #3
    Join Date
    Mar 2000
    Location
    Arkadelphia AR
    Posts
    224
    Thanks, Looks good.
    I'll give that a try.

    I did say I can use just the date.. seems I cant. I also need the time. Its a P2P EDI type system, and Im trying to save by date and time the transactions that are coming, and us sending out.

    Thanks again
    Rj
    Microsoft keeps my Old mind active. Right when I get one Op System figured out, we get a new one RjCrash
    *******************************

  4. #4
    Join Date
    Apr 2000
    Posts
    1,579
    Don't recall or know what a P2P EDI type is.
    Can you elaborate. Thanks?
    Open your mind, not your computer.

  5. #5
    Join Date
    Mar 2000
    Location
    Arkadelphia AR
    Posts
    224
    P2P is Point to Point, they send me a document to a fixed IP address (has to go through firewall, etc...) on a PC, I upload it to our AS-400 midrange.

    EDI is Electronic Data Interchange, Invoices, Po's, etc..etc..

    We send them an acknowledgement, or an invoice for orders.

    I download with one filename.. I want to save what I download on the PC, so I want the date/time tagging the file.
    Microsoft keeps my Old mind active. Right when I get one Op System figured out, we get a new one RjCrash
    *******************************

  6. #6
    Join Date
    Apr 2000
    Posts
    1,579
    Oh, OK Thanks
    Open your mind, not your computer.

  7. #7
    Join Date
    Mar 2000
    Location
    Arkadelphia AR
    Posts
    224
    Robert, Thanks a ton..
    That link you sent worked great. Got the job done.

    On that link, in win2k, I used THIS one for the string...

    for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
    for /f "tokens=1" %%u in ('time /t') do set t=%%u
    if "%t:~1,1%"==":" set t=0%t%
    set timestr=%d:~6,4%%d:~3,2%%d:~0,2%%t:~0,2%%t:~3,2%
    echo %timestr%

    With that, I was able to do an Xcopy myfile %timestr%.sent

    Works.

    Thanks again
    This forum is a lifesaver
    Rj
    Microsoft keeps my Old mind active. Right when I get one Op System figured out, we get a new one RjCrash
    *******************************

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •