Different infection problem

Hello, I have a problem with my PC. When I switch it off, cmd pops up and it says shutdown and then a message pops up and the computer turns off. This happens every time I turn it on but when I do it in safe mode it doesn’t happen. Help please!