somethins rong wit my batch file please help!

January 24, 2011 at 14:01:26
Specs: Windows XP
it is to delete backup files this is wat i got:
dir c:place\
del c:place\*.bak
@echo off
@echo on

See More: somethins rong wit my batch file please help!

Report •

January 24, 2011 at 14:19:58
You made it way too complex.

@echo off
del c:\place\*.bak

Report •

January 25, 2011 at 08:40:53
that didn't work

Report •

January 25, 2011 at 09:41:46
Works on mine. What is the error you get or the symptoms you get?

Must write in complete sentences for us to help. We can not read your mind.

Where are the files you want to delete? c:\places ? If not where?

What is an example name of the fie you would like to delete? Myfile.bak ?

Is there any criteria like only file of a certain date?

Last, it could be you need to verify the delete. Try...

echo y|del c:\place\*.bak

Report •

Related Solutions

January 25, 2011 at 10:28:06
erase /?
Deletes one or more files.

DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

names Specifies a list of one or more files or directories.
Wildcards may be used to delete multiple files. If a
directory is specified, all files within the directory
will be deleted.

/P Prompts for confirmation before deleting each file.
/F Force deleting of read-only files.
/S Delete specified files from all subdirectories.
/Q Quiet mode, do not ask if ok to delete on global wildcard
/A Selects files to delete based on attributes
attributes R Read-only files S System files
H Hidden files A Files ready for archiving
I Not content indexed Files L Reparse Points
- Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

The display semantics of the /S switch are reversed in that it shows
you only the files that are deleted, not the ones it could not find.

erase yourfullpath\*bak /q

Subhash Chandra.

Report •

January 25, 2011 at 10:53:37
Del deletes more than one file too. Erase use to make the file undeleteable otherwise the commands are the same.

Now days there are no differences in the command.

The opp is missing something. Like maybe the files are read only or the path is not right. He needs to post the results.

Report •

January 25, 2011 at 14:01:15
it cant find it . its in the c drive in my documents an example is attempt 1 .bak

Report •

January 25, 2011 at 14:37:42
Do you have the .bak file open?

Or it is in use by a program?

Happy is ONE who says I am an OttoMAN.

Report •

January 25, 2011 at 15:08:50
You mentioned it's in your "My Documents" folder, is that correct?

What is the exact command you're running that's resulting in failed results - does it reference the full path? What's the exact error?

Try this:

For Windows Vista or 7:
del %userprofile%\Documents\*.bak

For XP and below:
del "%userprofile%\My Documents\*.bak"

Report •

January 26, 2011 at 10:49:26
I do agree with you.Echo y | Del will also work same way as erase /q .
I didnt mean that Del will not work.just wanted him to know the differnet parameters he can use and try to fix himself.

Subhash Chandra.

Report •

Ask Question