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

LoadUserProfile API-call?

by Ordinary_User (Beadle)
on Sep 29, 2003 at 12:09 UTC ( #294934=perlquestion: print w/replies, xml ) Need Help??
Ordinary_User has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, fellow Monks!

I'm writing a Perl script that will be run as a Service on a Windows machine. This service should be able to install programs on demand and for a specific user. To be able to have the installation program install itself in the right part of the registry and in the right user-directories, I need to run the Windows API-call's LogonAsUser, LoadUserProfile and CreateProcessAsUser.

To LogonAsUser and CreateProcessAsUser, I use the Win32::AdminMisc module, but I also need the LoadUserProfile function.

I want to know if there is any module that provide this functionality "easily", or do I have to do it the hard way using Win32::API?

Thanks for taking the time reading my question.

Replies are listed 'Best First'.
Re: LoadUserProfile API-call?
by MZSanford (Curate) on Sep 29, 2003 at 12:43 UTC
    If you check out the source for Win32::NetAdmin at you can see that the function call for LoadUserProfile has been commented out (see adminmisc.cpp, line 1094). There is also a copy of the function itself. You may want to download the source and try to uncomment/recompile. If that does not work (assuming it is commented for a reason), then i would say Win32::API is the next stop.

    from the frivolous to the serious
      Thanks for your advice!

      Allthough I can't find what your're referring to in the sourcecode I'm thinking of following your second advice and go for the Win32::API. Since changing the C-code would be mean more trouble for me, I guess using the Win32::API would be the "easier" way. ;-)

Re: LoadUserProfile API-call?
by tachyon (Chancellor) on Sep 29, 2003 at 12:45 UTC

    Check out Dave Roth's Perl Win32 Widgets. You will find lots of goodies there....




      Thanks for your advice!

      I haven't found anything I feel will help me completely (yet), I'll look around some more.

      Possibly I can be helped by the Win32::API::Prototype module I found at the link you provided if I decide to go for the Win32::API-way.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://294934]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2018-12-10 19:22 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (51 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!