Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Windows 7 UAC with elevated privileges

by Michael Roberts (Sexton)
on Apr 25, 2014 at 13:39 UTC ( [id://1083788]=note: print w/replies, xml ) Need Help??


in reply to Re^2: 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.

Once you're not in elevated mode, you can't change - you can't "upgrade" a running process. You can even see this in Microsoft's own tools; the Task Manager has a button "Show processes from all users" when you start it as a non-administrative user. Click that button and you'll notice that the Task Manager window goes away and reappears, now with a checkbox instead of a button. That's because the non-elevated process had to be swapped out for an elevated one.

It's kinda weird, but eh. Windows.

  • Comment on Re^3: Windows 7 UAC with elevated privileges

Replies are listed 'Best First'.
Re^4: Windows 7 UAC with elevated privileges
by Anonymous Monk on Apr 26, 2014 at 08:54 UTC

    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", ], )

      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 :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-16 08:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found