• A little batch file magic

    From Sean Dennis@1:18/200 to All on Sun Jan 15 08:51:36 2006
    Hi, everyone.

    I'm trying to remember how to move certain files in a directory to another directory in a batch file. I want to copy the packets I get in in BT's inbound
    to a backup directory (that's saved my bacon before), but not all of the other files I get (TICs, ZIPs, et al).

    I was thinking that this might do it:

    for in (*.mo? *.tu? *.we? *.th? *.fr? *.sa? *.su?) copy * d:\backup

    Is that right? I really don't think it is (something's nagging me that it's missing)...

    Any help is appreciated.

    Thanks,
    Sean

    P.S. Thanks for all the help with my previous question. One thing I can always
    do in these echoes is learn...

    // sean@outpostbbs.net | http://outpostbbs.net | ICQ: 19965647

    --- Telegard/2 v3.09.g2-sp4/mL
    * Origin: Outpost BBS - bbs.outpostbbs.net (1:18/200)
  • From Johan Zwiekhorst@2:292/100 to Sean Dennis on Sun Jan 15 21:30:21 2006
    Hi Sean!

    In your message to All, dated <Sunday January 15 2006 08:51>, you wrote:

    SD: for in (*.mo? *.tu? *.we? *.th? *.fr? *.sa? *.su?) copy * d:\backup
    SD: Is that right? I really don't think it is (something's nagging me
    SD: that it's missing)...

    You might want to add plain mail packets (*.PKT).

    Kind regards,

    ._|~/_

    e-mail: johan@zwiekhorst.be_NOSPAM (home)
    web: http://www.zwiekhorst.be (personal)
    http://www.diskidee.be (our e-zine!)
    --- EMMA v0.9b
    * Origin: Tripod BBS Belgium - bortaS bIr jablu'DI'reH QaQqu' nay' (2:292/100)
  • From Peter Knapper@3:772/1.10 to Sean Dennis on Mon Jan 16 17:40:08 2006
    Hi Sean,

    I'm trying to remember how to move certain files in a
    directory to another directory in a batch file. I
    want to copy the packets I get in in BT's inbound to a
    backup directory (that's saved my bacon before), but
    not all of the other files I get (TICs, ZIPs, et al).

    I was thinking that this might do it:

    for in (*.mo? *.tu? *.we? *.th? *.fr? *.sa? *.su?) copy * d:\backup

    From the command line that should be -

    for %f in (*.mo? *.tu? *.we? *.th? *.fr? *.sa? *.su?) copy %f d:\backup

    That way you don't drop the FOR part and get everything with * ........;-)

    And if its in a batch file then its -

    for %%f in (*.mo? *.tu? *.we? *.th? *.fr? *.sa? *.su?) copy %%f d:\backup

    Cheers.............pk.


    --- Maximus/2 3.01
    * Origin: Another Good Point About OS/2 (3:772/1.10)
  • From Sean Dennis@1:18/200 to Peter Knapper on Mon Jan 16 08:35:42 2006
    Peter,

    *** Quoting Peter Knapper from a message to Sean Dennis ***

    From the command line that should be -

    Thanks for the corrections. I appreciate it.

    Later,
    Sean

    // sean@outpostbbs.net | http://outpostbbs.net | ICQ: 19965647

    --- Telegard/2 v3.09.g2-sp4/mL
    * Origin: Outpost BBS - bbs.outpostbbs.net (1:18/200)
  • From Sean Dennis@1:18/200 to Peter Knapper on Tue Jan 17 18:48:42 2006
    Peter,

    *** Quoting Peter Knapper from a message to Sean Dennis ***

    for %%f in (*.mo? *.tu? *.we? *.th? *.fr? *.sa? *.su?) copy %%f
    d:\backup

    Unfortunately, that didn't work. I just discovered that a day's worth of mail processing hadn't been done because that line kept causing my mail processing batch file to halt.

    The error?

    "copy was unexpected at this time."

    Later,
    Sean

    // sean@outpostbbs.net | http://outpostbbs.net | ICQ: 19965647

    --- Telegard/2 v3.09.g2-sp4/mL
    * Origin: Outpost BBS - bbs.outpostbbs.net (1:18/200)
  • From Peter Knapper@3:772/1.10 to Sean Dennis on Wed Jan 18 21:15:32 2006
    Hi Sean,

    for %%f in (*.mo? *.tu? *.we? *.th? *.fr? *.sa? *.su?) copy %%f
    d:\backup

    Unfortunately, that didn't work.

    Ooops, try adding the word DO before "copy".........;-)

    EG:

    [E:\Z]for %f in (sq?.msg) do copy %f \y

    [E:\Z]copy sq1.msg \y
    1 file(s) copied.

    [E:\Z]copy sq2.msg \y
    1 file(s) copied.

    [E:\Z]copy sq3.msg \y
    1 file(s) copied.


    Cheers...........pk.


    --- Maximus/2 3.01
    * Origin: Another Good Point About OS/2 (3:772/1.10)
  • From Sean Dennis@1:18/200 to Peter Knapper on Sun Jan 22 10:25:28 2006
    Peter,

    *** Quoting Peter Knapper from a message to Sean Dennis ***

    Ooops, try adding the word DO before "copy".........;-)

    Works perfectly now, thanks. :)

    Later,
    Sean

    // sean@outpostbbs.net | http://outpostbbs.net | ICQ: 19965647

    --- Telegard/2 v3.09.g2-sp4/mL
    * Origin: Outpost BBS - (423) 926-0556 - bbs.outpostbbs.net (1:18/200)