O'Reilly logo

Win32 Perl Programming: The Standard Extensions, Second Edition by Dave Roth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Case Study: Running Applications as Another User

Suppose you are an administrator, and you sometimes have to log on to your machine as another user to test for security permissions and such. You can log off of your workstation and log on as that user, but this would require you to close all your applications. Assume, for the sake of argument, that your work habits are like mine, and you have 50 or so windows open, all running different, seemingly important processes. This makes logging off a bit undesirable.

You decide to let Win32 Perl help you out of this dilemma, so you use a Perl script that will impersonate the user and run a program as that user. The script in Example 8.9 provides this functionality.

Example 8.9. Running an application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required