def prepend_reserved_windows_names(parts: list):
    """
    Prepend the first part of a file or directory name with underscore if that name part is a reserved windows name.

    The prepend is applied in all operating systems.

    Parameters
    ==========
    parts : list
        list of parts making up the name.  parts in the list are in order i.e. part[0] is the first part

    Returns
    =======
    list:
        list of parts modified if required

    """

    reserved_names = {'con', 'prn', 'aux', 'nul', 'com1', 'com2', 'com3', 'com4', 'com5', 'com6', 'com7', 'com8',
                      'com9', 'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5', 'lpt6', 'lpt7', 'lpt8', 'lpt9'}

    if parts[0].lower() in reserved_names:
        parts[0] = f'_{parts[0]}'

    return parts