Jump to content

Recommended Posts

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
Posted

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 ]---
  • 2 weeks later...
Posted

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)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...