I do not know Windows quite well, but I cannot write a folder/file in the C:/Programs (x86) folder where normally programs are installed. I guess it has with restrictions to do. The following code works fine with all other $TargetDir folders, exept the "Programs (x86)" where it ends without dying because it creates another folder with the same name.
use File::Copy::Recursive qw(dircopy);
my $TargetDir="C:/Programs (x86)";
dircopy($SourceDir,$TargetDir) or die("$!\n");
Furthermore, I guess the "Programs (x86)" is called differently depending on the locale. Is there is a way to get it programmatically?
PS: I am trying to create an "updater" for a program. This need to download the newest .exe version from server and replace the existing one.