in reply to Re^3: Windows 7 UAC with elevated privileges
in thread Windows 7 UAC with elevated privileges

I don't think it should matter - it's actually closing the current (non-elevated) process and starting the same thing again from the shell with elevated privileges, so it's going to reload @INC the same way anyway.

Look again because that is what it currently isn't doing, @INC is not @ARGV

$ perl -Ishabba -e " use Data::Dump; use Devel::PL_origargv; dd( \@INC +, \@ARGV , [ Devel::PL_origargv->get ] )" -- ro sham bo ( [ "D:\\PL_origargv_shoulndtuseinlinedirectly\\_Inline\\lib", "shabba", "C:/citrusperl/site/lib/MSWin32-x86-multi-thread", "C:/citrusperl/site/lib", "C:/citrusperl/vendor/lib", "C:/citrusperl/lib", ".", ], ["ro", "sham", "bo"], [ "C:\\citrusperl\\bin\\perl.exe", "-Ishabba", "-e", " use Data::Dump; use Devel::PL_origargv; dd( \\\@INC, \\\@ARGV , +[ Devel::PL_origargv->get ] )", "--", "ro", "sham", "bo", ], )

Replies are listed 'Best First'.
Re^5: Windows 7 UAC with elevated privileges
by Michael Roberts (Sexton) on Apr 26, 2014 at 12:59 UTC

    Ah! I see what you mean. @ARGV isn't actually the OS-level arguments passed to the interpreter because there's some logic before that.

    Excellent - thank you! I'll put that into the next version. I figured that simplistic handling of the command line was probably going to be a problem, but I had no idea it was that weird...

      :) You might also want to warn (in the docs) to add the  use Win32::RunAsAdmin qw(force); as soon as possible ... in case some other modules change cwd :) as PL_origargv doesn't track cwd :)

        Hey - I just wanted to thank you again. If you hadn't forced me to understand what you were saying, I would have had no idea where to start looking when I used Win32::RunAsAdmin (without force) and Getopt::Euclid to determine based on a command-line flag whether to request elevated privileges or not.... and the command line disappeared (!) As it was, it was obvious what had happened.

        Anyway, v0.02 is up. Thanks.