Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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 strict; use warnings; use File::Copy::Recursive qw(dircopy); my $SourceDir="C:/test"; 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Write file in Windows Programs folder
by stevieb (Canon) on Jan 24, 2018 at 22:26 UTC | |
|
Re: Write file in Windows Programs folder
by soonix (Chancellor) on Jan 24, 2018 at 22:36 UTC | |
by papidave (Pilgrim) on Jan 25, 2018 at 04:16 UTC | |
by Anonymous Monk on Jan 25, 2018 at 18:39 UTC | |
|
Re: Write file in Windows Programs folder
by salva (Canon) on Jan 25, 2018 at 07:54 UTC | |
by Anonymous Monk on Jan 25, 2018 at 10:06 UTC | |
by salva (Canon) on Jan 25, 2018 at 10:09 UTC | |
by Anonymous Monk on Jan 25, 2018 at 18:34 UTC | |
|
Re: Write file in Windows Programs folder
by GrandFather (Saint) on Jan 25, 2018 at 23:29 UTC | |
|
Re: Write file in Windows Programs folder
by IB2017 (Pilgrim) on Jan 26, 2018 at 08:57 UTC |