They're both correct. The 'you are not to do' structure is used for giving strong commands. The second could not always be used for a simple comand- 'you are not going to touch that switch' doesn't work very well. however, here it works because the speaker is taking control of the person they are speaking to.
- For Teachers