The new title derivatives (4b-h and 5a-i) were synthesized by reaction of the appropriate primary amine, carbon disulphide, and formaldehyde. These derivatives were prepared in order to study the effects of introducing polar groups at N3 or N5 or at both positions on the biological activity. The compounds were tested for their antifungal activity in vitro against pathogenic (Trichophyton rubrum and Candida albicans), phytopathogenic (Penicillum expansum, Trichoderma hazianum, and Fasarium oxysporum), and aflatoxin-producing (Aspergillus flavus) fungi. These compounds exhibited varied inhibitory effects on growth or sporulation of some tested fungal species.