Jump to content

RunAsWait getting errors


Recommended Posts

We are trying to limit the user's direct access to data on the network.  The users have access to the programs, but not direct access to the data.  The Service id has the direct access to the programs and data.

When I do a Shift Right Click and run my AutoIt program with the Service Id and Password the RunWait works correctly.  When I run the AutoIt program with the user's id and password then call RunAsWait, I get errors.

1) Run icon ServiceId  - RunWait ($sCallProgram) works

2) Run icon as UserId - RunAsWait($sServiceName, @LogonDomain, $sServicePassword, 0, $sCallProgram,  @WorkingDir, @SW_MAXIMIZE)

Logon_flag = 0 gets error 1326, 1 gets errror 1326, 2 gets error 267, and 4 gets error 1783

Any suggestion would be welcomed.  I tried looking on the Forums, but I didn't find much.  I did see a brief statement that both the user and service id's would need access to the data. but that is what we are trying to prevent.


Link to comment
Share on other sites

I've got a workaround to this problem.  My program was setting some environment variables to the data location before it was calling the RunAsWait.  So I broke the progam into 2 seperate programs.  The first program validates the user can log into the system and run the programs.  Then it calls the program to set up the environment and data using the RunAsWait using the service id.  This fixed the problem I was getting with the different logon_flag errors.

Link to comment
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

  • Recently Browsing   0 members

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