Batch File execution problem

prm123

New member
Local time
6:43 PM
Messages
1
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

Computer type
Laptop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 Professional
CPU
Intel I5
Memory
8GB
Antivirus
Kaspersky
Browser
Chrome
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

Computer type
Laptop
Computer Manufacturer/Model Number
HP Elitebook 8540p
OS
Windows 7 Pro 32
CPU
Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz
Motherboard
Hewlett-Packard 1521
Memory
4,00 GB (Usable 2,98)
Graphics Card(s)
NVIDIA NVS 5100M
Sound Card
NVIDIA High Definition Audio
Screen Resolution
1600x900
Hard Drives
INTEL SSDSA2CW120G3
Antivirus
F-Secure Internet Security
Browser
IE, Firefox, Opera
Other Info
Sandboxie,
SRP (Software Restriction Policy),
EMET (Enhanced Mitigation Experience Toolkit),
WFC (Windows Firewall Control by BiniSoft),
Malwarebytes Premium
Back
Top