Batch File execution problem


  1. Posts : 1
    Windows 7 Professional
       #1

    Batch File execution problem


    I have created a batch program as listed below. It is supposed to read all MP3 files from given folderMP3_CDs_12GB recursively and write to three folders B0 (first 999 files), B1 (next 999 files) and B2 (balance of about 2,800 files). It should also write three text files with the File serial Nimber and name of file with complete path to three corresponding text files Mp3_0.txt (first 999 files), MP3_1.txt (next 999 files) and MP3_2.txt (balance files).

    The batch program is listed below:
    ---------------------------------------------------------------------------------------
    @echo off
    SetLocal EnableDelayedExpansion
    set /A x=0
    set dest=

    For /F "delims=," %%f in (MP3_CDs_12GB) DO (
    set /A x+=1
    if !x! leq 999 goto B0
    if !x! leq 1999 goto B1
    if !x! leq 2800 goto B2
    goto continue

    :B0
    copy "%%f" "e:\Fls_MP3\B0\"
    echo !x! %%f >> "e:\Fls_MP3\MP3_0.txt
    goto continue
    :B1
    copy "%%f" "e:\Fls_MP3\B1\"
    echo !x! %%f >> "e:\Fls_MP3\MP3_1.txt
    goto continue
    :B2
    copy "%%f" "e:\Fls_MP3\B2\"
    echo !x! %%f >> "e:\Fls_MP3\MP3_2.txt
    goto continue
    :continue
    echo atContinue
    echo "Next file"
    )
    :finish
    echo "Finished"
    goto :eof
    --------------------------------------------------------------------

    When executed it gives error "Syspen cannot find file specifies and halts. Any help will be appreciated.
      My Computer


  2. Posts : 1,049
    Windows 7 Pro 32
       #2

    Hi and welcome to SevenForums!

    Does if process any file at all before the error, or is it a problem with a specific file?

    You could remove the line with @echo off or add new lines with only the word pause in between other lines to find out what line is causing the error. When you find what line is casing the error it's easier to solve the problem :)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:49.
Find Us