pdf compress scripts

I need a script through which I can compress a pdf file and save it in a separate folder.
I tried through CMD, but it didn’t work out for me.
I tried to do it like this:

pdf24-creator.exe /PrintFile "C:\1\2.xlsx" /PrinterName "PDF10" /Outputfile "C:\1\2\kdfd.pdf"


you have the "wrong" PDFCreator, our executable is just PDFCreator.exe and the docs will only work for our software. You can download the free edition here.
After installing it, the above command should work, although you only need to specify the printer's name if you create multiple of our virtual PDFCreator printers, otherwise you can leave it out.

Best regards