Sure, why not? I am not at home so I cannot look up the actual rules or text along with cantrips but to my knowledge they are simple enough that after the repetition they can be cast at will without a lot of effort. If this is the case of a player wizard trying to get cantrips out of an enemy...