• Batch File...

    From Shurato@618:300/50 to All on Wednesday, October 23, 2024 11:42:00
    What's wrong with this batch file? It only appears to grab the first directory, instead of all subdirs. Sometimes it doesn't even do that.. f

    for %%i in (*.) DO (
    cd %%i
    del shortlist.bbs
    for %%j in (*.zip) DO (
    pkunzip -o %%j file_id.diz %temp%
    set /p output=<%temp%\file_id.diz
    echo %%j %output%>>shortlist.bbs
    )
    cd ..
    )

    I'm sure I missed something obvious, but I can't figure it out. Can I not
    nest for do loops? This is to grab the first line of file_id.diz files, put the filename a few spaces, then the description into a file for my ftp server to display descriptions. pkunzip and set are working. It's not looping though.

    --
    Shurato, Sysop Shurato's Heavenly Sphere (ssh, telnet, pop3, ftp,nntp,
    ,wss) (Ports 22,23,110,21,119,8080) (ssh login 'bbs' pass 'shsbbs').


    *** THE READER V4.50 [freeware]
    ---
    * Origin: Shurato's Heavenly Sphere telnet://shsbbs.net (618:300/50)
  • From Shurato@618:300/50 to Shurato on Wednesday, October 23, 2024 23:06:00

    What's wrong with this batch file? It only appears to grab the first directory, instead of all subdirs. Sometimes it doesn't even do that.. f

    for %%i in (*.) DO (
    cd %%i
    del shortlist.bbs
    for %%j in (*.zip) DO (
    pkunzip -o %%j file_id.diz %temp%
    set /p output=<%temp%\file_id.diz
    echo %%j %output%>>shortlist.bbs
    )
    cd ..
    )

    I've edited this some to specify %1 as the path determined and used that for the initial directory and the paths, removing the cd .. but that didn't seem
    to help any. It should have worked around the "." and ".." paths.

    --
    Shurato, Sysop Shurato's Heavenly Sphere (ssh, telnet, pop3, ftp,nntp,
    ,wss) (Ports 22,23,110,21,119,8080) (ssh login 'bbs' pass 'shsbbs').


    *** THE READER V4.50 [freeware]
    ---
    * Origin: Shurato's Heavenly Sphere telnet://shsbbs.net (618:300/50)
  • From Shurato@618:300/50 to Shurato on Friday, October 25, 2024 15:21:00

    What's wrong with this batch file? It only appears to grab the first directory, instead of all subdirs. Sometimes it doesn't even do that.. f

    for %%i in (*.) DO ( cd %%i del shortlist.bbs for %%j in (*.zip)
    DO ( pkunzip -o %%j file_id.diz %temp% set /p
    output=<%temp%\file_id.diz echo %%j %output%>>shortlist.bbs
    ) cd .. )

    I'm sure I missed something obvious, but I can't figure it out. Can I not nest for do loops? This is to grab the first line of file_id.diz files, put the filename a few spaces, then the description into a file for
    my ftp server to display descriptions. pkunzip and set are working.
    It's not looping though.

    It's not doing subdirs, so maybe I should remove that part and do it manually in each directory... There are several score of them...

    --
    Shurato, Sysop Shurato's Heavenly Sphere (ssh, telnet, pop3, ftp,nntp,
    ,wss) (Ports 22,23,110,21,119,8080) (ssh login 'bbs' pass 'shsbbs').


    *** THE READER V4.50 [freeware]
    ---
    * Origin: Shurato's Heavenly Sphere telnet://shsbbs.net (618:300/50)
  • From Floris van Unen@618:500/66 to Shurato on Saturday, October 26, 2024 10:30:32

    Hello Shurato!

    23 Oct 24 11:42, you wrote to all:

    set /p output=<%temp%\file_id.diz

    according to internet forums it needs CALL in front of SET.

    regards,
    Floris


    --- GoldED+/LNX 1.1.5--b20170303
    * Origin: ----> Fidian on Azure West-Europe (Holland) IPV6. (618:500/66)