Emmcdl flash

Hello sir unfortunately my persist partition damaged and my device is redmi 4x now the problem is I can’t flashing persist partion so I am requesting you to give me a detailed script which to create a emmcdl.bat file which automatically recognize my device port and automatically dump prog_emmc_firehose_8937_ddr.mbn
Please help me sir.