Use the words around the verbal noun to identify its purpose.
شَكَرْتُهُ شُكْرًا — I certainly thanked him.
شُكْرًا emphasizes the thanking.
مَشَى الطِّفْلُ مَشْيًا سَرِيعًا — the child walked quickly.
سَرِيعًا makes مَشْيًا describe the quality of walking.
طَرَقْتُ الْبَابَ طَرْقَةً وَاحِدَةً — I knocked on the door once.
وَاحِدَةً makes the phrase state the number.