Hadithcore
Mishkat al-Masabih, 70
graded· Zubair `Aliza'i

He also reported God's messenger as saying, "The cry of an infant at the moment of birth is due to a prick from the devil.” (Bukhari and Muslim.)

وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «صِيَاحُ الْمَوْلُودِ حِينَ يَقَعُ نَزْغَةٌ من الشَّيْطَان»

References1 variant
In-Book Reference
Book 1, Hadith 64