use Win32::OLE; Win32::OLE->Option(Warn => 3); #die on error ... #Create Physical Folders eval{ my $fs = Win32::OLE->CreateObject("Scripting.FileSystemObject"); $fs->CopyFolder("$PhysicalPath\\Template", "$PhysicalPath\\$SiteNum", 1); }; if($@){ #Some error handling stuff here }