Continue -- Delete files older than Xdays

B

Babu

Iam executing the below command.. It errors out saying
invalid directory.. because it cannot understand the
directory name more than 8 characters. Let me know is
there any fix for the same
 
P

Paul R. Sadowski

You didn't quote the path:
forfiles -p"C:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\" -s -m*.Bak -d-4 -c"CMD /C DEL /Q ""@PATH\@FILE""
 
P

Phil Robyn [MVP]

Babu said:
Iam executing the below command.. It errors out saying
invalid directory.. because it cannot understand the
directory name more than 8 characters. Let me know is
there any fix for the same
--------------------------------------------
forfiles -pC:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\ -s -m*.Bak -d-4 -c"CMD /C
DEL /Q ""@PATH\@FILE""

--------------------------------------------

Appreciate ur help

Babu

Type 'FORFILES -?' at the CMD prompt for some examples. Your
problems have to do with your use of too many or too few double
quotes. For example, you will have to use

. . . -c"CMD /C DEL /Q 0x22@PATH\@FILE0x22"

instead of what you are using. Also, the path after '-p' must
be enclosed in double quotes since there are spaces in the path.
 
B

Babu

Thanks a lot for your inputs it works

Babu
-----Original Message-----
You didn't quote the path:
forfiles -p"C:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\" -s -m*.Bak -d-4 -c"CMD /C DEL /Q ""@PATH\@FILE""




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top