Wmic call uninstall java. This command should work in windows 7 & above.