Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 07-12-2004, 12:59 AM   #1
Baseband Member
 
sean82007's Avatar
 
Join Date: May 2004
Posts: 87
Default Batch File Help ASAP

Alright Im trying to create a program that deletes all the .mp3 files in a certain folder. But whenever I typed the location, it says could not find the specified location or file. Heres the code.

@ECHO OFF
PAUSE
ECHO This deletes all your mp3 files within ur My Documents folder!!!
PAUSE
ECHO Press any key to continue.....
C:\My Documents\My Music
ECHO Deleting Files
del *.mp3
ECHO Your computer is now clean from mp3's!!!
PAUSE

I just started coding with batch about 2 days ago. But I need help please. Could u help me.

---- This is what it says when I execute the prog!!! ----

Press any key to continue ...
This deletes all of your mp3 files within ur My Documents folder!!!
Press any key to continue...
Press any key to continue.....
'C:\My' is not recoginized as an internal or external command,
operable program or batch file
Deleting Files
Could Not Find C:\Documents and Settings\Owner\My Documents\*.mp3
Your computer is now clean from mp3's!!!
Press any key to continue...

--- Please Help ---
__________________

sean82007 is offline   Reply With Quote
Old 07-12-2004, 04:23 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: Batch File Help ASAP

I think the problem is you are changing directories in one line.
Because of the space in the my documents folder you are effectivly trying to run c:\my as if it were an excecutable file (c:\my.exe).
you could try changing the line
c:\my documents\my music
to
c:
cd my documents\my music\

another thing you might be interested in would be changing the line del *.mp3 to
del *.mp3 > deletedmp3s.txt
This will create a new text file detailing all the files deleted.
(hope this helps)
__________________

root is offline   Reply With Quote
Old 07-13-2004, 01:09 AM   #3
In Runtime
 
Join Date: May 2004
Posts: 227
Send a message via AIM to Itsme Send a message via MSN to Itsme
Default Re: Batch File Help ASAP

You may have already checked, but I'll tell you this to make sure:
Is your My Documents folder in your C: drive? or is it in something like c:\documents and settings\administrator\my documents\my music

Also, the other problem could be with the [space]'s in the address. You can try putting in what root said above, though I haven't tried that. Also, you can try something like C:\DOCUME~1\, but I don't know what the other folders are called after that

Good luck

Itsme
Itsme is offline   Reply With Quote
Old 07-14-2004, 02:02 PM   #4
Baseband Member
 
sean82007's Avatar
 
Join Date: May 2004
Posts: 87
Default Re: Batch File Help ASAP

yea thanks anyway but it didn't work oh well ima keep tryin.
sean82007 is offline   Reply With Quote
Old 07-14-2004, 07:47 PM   #5
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: Batch File Help ASAP

OK,
in that case a little bit more information is needed, I tired out the lines I wrote in your batch file before I posted then in windows XP, it might be that you are using a different version of windows, or something else is a little differnet, could you post the batch file here again, and post the results here.

you could also try writting the batch file line by line into the command prompt to see where it goes wrong.
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:50 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0