clubfx2, instead of finding a way around the problem, wouldn't you prefer to find out what was causing the problem. The shutting down problem is not normal and you should try to find out what is hanging the server instead of writing a script that will force the shutdown.
However, if you did all that you could and still could solve the problem, then I would agree with the script solution. Nevertheless, I would have to agree with aSugarBe. Try to find the program or service that is causing the server to hang. Do you have any EDI Scripts that run from this server, any scheduled tasks. When did you start having this problem? What new software(if any) was installed on the Server? What was the last Service pack or Hotfix installed on the Server? If you can, try to shut down all other switches except the master switch so that no users are connected, then try a shutdown. Obviously, there is something still running on the server that is stopping it from shutting down, you shuld troubleshoot the problem before settling for a work around solution.