Sign in to follow this  
Followers 0
giggity

Adding TCP printer ports w/ admin rights

3 posts in this topic

#1 ·  Posted (edited)

I am trying to add some tcp printer ports for non admin users via login script. I am trying to use RunAsSet to handle the admin rights. I have compiled a total of two scripts in order to try and accompplish this task. The first executable simply calls the second executable with admin rights. I am trying to execute these scripts off a network share so I don't know if thats causing a problem.

Code inside first executable

RunAsSet("administrator","mydomain","password")
Run("addport.exe")
RunAsSet()
Exit
oÝ÷ Ø*z)ì×­í§uì^rëZnWuÚh®×±y«­¢+Ø(ÀÌØíÈôÅÕ½ÐìÄäȸÄØà¸Ä¸ÌÐÅÕ½Ðì(ÀÌØíA9ÕµÈôÅÕ½ÐìäÄÀÀÅÕ½Ðì)5­9ÝA½ÉÐ ÀÌØíÈ°ÀÌØíA9յȤ(((ÀÌØíÈÈôÅÕ½ÐìÄäȸÄØà¸Ä¸ÌÔÅÕ½Ðì(ÀÌØíA9ÕµÈÈôÅÕ½ÐìäÄÀÀÅÕ½Ðì)5­9ÝA½ÉÐ ÀÌØíÈÈ°ÀÌØíA9ÕµÈȤ((ÀÌØíÈÌôÅÕ½ÐìÄäȸÄØà¸Ä¸ÌØÅÕ½Ðì(ÀÌØíA9ÕµÈÌôÅÕ½ÐìäÄÀÀÅÕ½Ðì)5­9ÝA½ÉÐ ÀÌØíÈÌ°ÀÌØíA9ÕµÈ̤((ÀÌØíÈÐôÅÕ½ÐìÄäȸÄØà¸Ä¸ÌÜÅÕ½Ðì(ÀÌØíA9ÕµÈÐôÅÕ½ÐìäÄÀÀÅÕ½Ðì)5­9ÝA½ÉÐ ÀÌØíÈаÀÌØíA9ÕµÈФ()Õ¹5­9ÝA½ÉÐ ÀÌØíÉÍÌ°ÀÌØíA½ÉÑ9յȤ($ÀÌØí½©]5%MÉÙ¥ô=©Ð ÅÕ½ÐíÝ¥¹µµÑÌèÀäÈìÀäÈìÅÕ½ÐìµÀì
½µÁÕÑÉ9µµÀìÅÕ½ÐìÀäÈíɽ½ÐÀäÈí¥µØÈÅÕ½Ðì¤($ÀÌØí½©9ÝA½ÉÐôÀÌØí½©]5%MÉÙ¥¹Ð ÅÕ½Ðí]¥¸ÌÉ}Q
A%AAÉ¥¹ÑÉA½ÉÐÅÕ½Ð줹MÁݹ%¹Íѹ|(($ÀÌØí½©9ÝA½Éй9µôÅÕ½Ðí%A|ÅÕ½ÐìµÀìÀÌØíÉÍÌ($ÀÌØí½©9ÝA½ÉйAɽѽ½°ôÄ($ÀÌØí½©9ÝA½Éй!½ÍÑÉÍÌôÀÌØíÉÍÌ($ÀÌØí½©9ÝA½ÉйA½ÉÑ9ÕµÈôÀÌØíA½ÉÑ9ÕµÈ($ÀÌØí½©9ÝA½ÉйM95A¹±ô±Í($ÀÌØí½©9ÝA½ÉйAÕÑ|)¹Õ¹(

I have tested the second executable by running it by itself under an administrator account without any errors whatsoever so I know the code works. When I try and execute the code as an admin or non admin off the network share with the first executable I get the following error:

http://www.autoitscript.com/forum/index.ph...st&id=10554

Thanks in advance

Edited by giggity

Share this post


Link to post
Share on other sites



I've found the same problem with RunAsSet (running it off a network share).

Try creating a shortcut to the exe and setting the working directory to be a local drive. (e.g. C:, D: etc)


----[ SandyD ]---

Share this post


Link to post
Share on other sites

In XP, "runas" command fails when you run programs from mounted network drives.

To get around it, you may

1) copy file to local disk for its execution

2) use the UNC path (Eg \\192.168.1.23\myshare\myprog.exe)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0