Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Batch File execution problem

22 Sep 2014   #1

Windows 7 Professional
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

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

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

My System SpecsSystem Spec
22 Sep 2014   #2

Windows 7 Pro 32

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 System SpecsSystem Spec

 Batch File execution problem

Thread Tools

Similar help and support threads
Thread Forum
Getting input data after execution of batch file.
My batch file code is like this: @echo off C:\Windows\System32\netsh.exe wlan set hostednetwor mode=allow ssid=User_Name key=password eyUsage=persistent In this code the "User_name" and "password" fields I want the input from the user after running the batch file. How do I make it...
General Discussion
Batch File Execution error
Please I need help! I have been on this stuff for over hours now..and no headway out. I want to write a batch script that can run tshark as shown below...
Performance & Maintenance
Batch file related problem,Pls help
Hi, I have downloaded db-derby database and unzipped it to my computer's C drive.To start the service I need to run startNetworkServer.bat file (windows batch file).But it did not run so I am unable to proceed further. Please let me know the solution for the same ASAP.I have tried to run it...
General Discussion
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion
Batch file problem
I have made a word game in notepad and saved it off as a batch file. Whenever I open this batch file it flashes onto the screen for a second and then goes away. Any solutions?
General Discussion
Another batch file permissions problem
Just recently there was a batch file permissions problem posted here. I'm also trying to run a command window, but my problem is a bit different. I have a batch file that cleans out programs' cache before shutting down the system, that I use every night to sign off. Since I demoted my normal...
General Discussion

Our Sites

Site Links

About Us

Find 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 12:25.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App