sub rootMeAndDoStuff(){ my $rootID = getpwnam("root"); if (not ($rootID eq $<)){ print "U have to be root to do the following ...\n"; system "su -c $PartToDoAsRoot"; } } #### sub adminMe(){ my $adminID = 0; if (not ($adminID eq $<)){ print "U have to be an Administator to do this ...\n"; print "Give me a name of a local Administator:\n"; my $admin = ; chomp $admin; my $hostname = hostname; system "runas /user:$hostname\\$admin \"cmd /K perl $whatToDoAsAdmin\""; } }