shuts down the system??
You have included API or WMI functions in there?If not i suspect a virus.