I managed to write a script for flashing hex file into STM microcontroller.
"C:\Program Files\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-Link_CLI.exe" -c UR FREQ=80 -ME -P "C:\Usr\someHex.hex" 0x08000000 -V -TVolt
Although it is showing that the process has completed and flashed the program. I can not see anything when I manually connect to the STM32 ST-Link Utility.
Although the command line is showing that the HEX file has flashed properly but STM32 ST-Link shows that the script did not flash the hex file properly.
Can anyone recommend me the solution?