I wrote a VFP9 app that we use to install software on our network by launching external installers on from the network(ex: f:\setup\setup.exe). Now that we're switching everyone from Windows PowerUsers to Standard users - it runs the installers, but the installers fail. What I am doing now to get around this is running an external script from my VFP app with 'runnas.exe' using credentials of the local root user (I know the password.) Then, in that script (which now has local admin rights), I add the Standard user to the Admin group, launch 'CPAU.exe' to run the installer off the network with credentials of the current user (which now has admin rights as well as drives mapped, etc), then remove the Standard user from the Admin group. It works because most of our users don't have Windows user passwords (and CPAU allows me to pass a blank password - something 'runas' won't.) HOWEVER - if the user has a password it fails. So now I prompt the user for the password then use what was typed in. What I need help on is ... GEEZ, seems like there ought to be a better way. I've looked at a Win32 API call that seems related:
But I have to admit I'm getting well out of my territory. Does anyone have any idea of how I might do this more elegantly? Particularly by using the Win32 API rather than these external command line apps? Or at very least, if I could check for a blank password so I don't have to prompt those without passwords to type it in? (I suspect I haven't included enough info - my head has been spinning all day on this - I apologize in advance if I'm not clear.)
But I have to admit I'm getting well out of my territory. Does anyone have any idea of how I might do this more elegantly? Particularly by using the Win32 API rather than these external command line apps? Or at very least, if I could check for a blank password so I don't have to prompt those without passwords to type it in? (I suspect I haven't included enough info - my head has been spinning all day on this - I apologize in advance if I'm not clear.)