[GIS] How to convert all shapefiles in folder into KML using ArcPy

arcgis-10.1arcpyerror-000732kmlshapefile

I was trying to convert all the shp in a folder into kml.

featureclasses = arcpy.ListFeatureClasses()

for fc in featureclasses:

 # Set Local Variables

 composite = 'COMPOSITE'

 pixels = 1024

 dpi = 96

 clamped = 'CLAMPED_TO_GROUND'

 scale = 1

 outKML = fc[:-4] + ".kmz"

 arcpy.LayerToKML_conversion(fc,outKML, scale, composite,'', pixels, dpi, clamped)

It always says
Failed to execute. Parameters are not valid.
ERROR 000732: Layer: Dataset ZZZ.shp does not exist or is not supported
Failed to execute (LayerToKML).

But I can manually do it within ArcMap 10.1 Desktop…