def delete_reparse_point(filepath):
	""" Remove the reparse point folder at filepath. """
	dwRet = 0
	with open_file(filepath) as hFile:
		# Try to delete it first without the reparse GUID
		info = ReparsePoint()
		info.ReparseTag = 0
		result, dwRet = DeviceIoControl(hFile, FSCTL_DELETE_REPARSE_POINT, byref(info),
										REPARSE_GUID_DATA_BUFFER_HEADER_SIZE , None, 0L)

		if not result:
			# If the first try fails, we'll set the GUID and try again
			buffer = get_buffer(filepath, hFile)
			info.ReparseTag = buffer.ReparseTag
			info.ReparseGuid = info.ReparseGuid
			result, dwRet = DeviceIoControl(hFile, FSCTL_DELETE_REPARSE_POINT, byref(info), 
											REPARSE_GUID_DATA_BUFFER_HEADER_SIZE, None, 0L)
			if not result: raise WinError()
	
	if not RemoveDirectory(filepath):
		raise WinError()
	
	return dwRet
 Remove the reparse point folder at filepath. 
recipes/Python/578849_Reimplementatirmtree_supporting_Windows_reparse_/recipe-578849.py