The following example writes a point shapefile to disc. However, I get an error when the script tries to write a shapefile to C:/. I am able to write to a external hard drive
Simple answer, do not write to the root-level directory of the system volume.
There are a few good reasons to create files/directories at the root of C:, but this isn't one of them. Use C:/Temp/test instead.
C:
C:/Temp/test