Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Write file in Windows Programs folder

by papidave (Pilgrim)
on Jan 25, 2018 at 04:16 UTC ( #1207878=note: print w/replies, xml ) Need Help??


in reply to Re: Write file in Windows Programs folder
in thread Write file in Windows Programs folder

Before you panic about UAC, you may want to verify that this isn't a simple case of trying to run from a non-admin account. Right-click on the command prompt icon, RunAs Administrator, and launch your Perl script from there. If it works as an admin user, you can probably code a test for that and tell the user what to do if it fails. (I do most of my Perl in Linux, so I'm probably not the best person to help you with that part).

If open my $fh, '>', $path or die "Can't open $path: $!\n"; still fails on your programs dir when run as an admin, then you can panic.

Replies are listed 'Best First'.
Re^3: Write file in Windows Programs folder
by Anonymous Monk on Jan 25, 2018 at 18:39 UTC

    No solution worked. I can not write/copy in the Programs folder. I packed the script in an exe in order to run it as Administrator (do not know how to run a script as Administrator), but nothing is written in the Programs folder.

    However, there are some programs installed in the same folder doing automatic updates, which I guess means automatic replace some files in the installation folder. I am a bit scared of looking into the "writing rights" matter. Just seems to complicated for me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1207878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2019-11-21 14:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (104 votes). Check out past polls.

    Notices?