Cows aren\'t the most intelligent of species, so I doubt a \"virtual\" fence would actually work with them.
With a physical electric fence it would go somethig like :-
\"mmm it hurts when I touch that fence\" and after maybe the 100th shock the cow may actually retreat from it and learn to avoid it in future.
If the cow was just plodding along and received a belt for seemingly no apparent reason, then I doubt it would be smart enough to realise that in order to stop getting a shock it needs to go into reverse. (cows don\'t corner quickly)
How it could happen :-
Cow walking along sedatley minding it\'s own business. *bang* it gets a shock for seemingly (to it) no reason at all. Cow bolts at 30mph to try and get away from what is annoying it. Cow bolts in the direction it is facing, as it sees no visible reason why it can\'t go that way. Cow ends up miles away from where you want it to be and is totally freaked by the time you find it after receiving multitudes of zaps for no apparent reason to it. Cow attacks the first living thing it sees as that thing must have caused the pain as it is the nearest thing to it.
It may work with students, but you would need to tell them that if they got a shock, then they have gone out of bounds and need to retreat otherwise they too would probably find it hard to work out why they got a belt and most students are several orders of magnitude more intelligent than your average cow. A couple of them may even work out to reflash the thing and play warcraft on it rather than it giving them a belt.
The trouble is how do you teach a cow *how to react* to the shock?
You are far better simply sending out a bloke with a bucket full of cattle feed, they would blindly follow him everywhere he goes.