Delete studies via dicom

Is there any way to do this? I know I can delete the studies using the rest api, but I don’t want to use http to this

No, deleting studies is not possible through the DICOM protocol.

ok, few more questions.

How does Orthanc delete the studies when MaximumPatientCount or MaximumStorageSize is set? The http server whould be activated, right?

Related to the one before, is there any way to delete the studies after X days after being indexed? Any option or anything like that

How does Orthanc delete the studies when MaximumPatientCount or MaximumStorageSize is set? The http server whould be activated, right?

This is explained in the Orthanc Book:
http://book.orthanc-server.com/faq/features.html#recycling-protection

In its database, Orthanc associates a sequence number to each newly received patient, which is used to implement a FIFO recycling policy: The oldest patient is removed first. Protected patients are immune to this recycling process.

This feature is independent of the HTTP server (REST API). Files received by the DICOM protocol are affected as well.

Related to the one before, is there any way to delete the studies after X days after being indexed? Any option or anything like that

You’ll have to script using the REST API, e.g. taking advantage of the “/changes” URI by monitoring the “NewStudy” change type:
http://book.orthanc-server.com/users/rest.html#tracking-changes