Continue -- Delete files older than Xdays

  • Thread starter Thread starter Babu
  • Start date Start date
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
 
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""
 
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.
 
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""




.
 
Back
Top