Jump to content
Sign in to follow this  
SCarter

RunAsWait getting errors

Recommended Posts

SCarter

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.

 

Share this post


Link to post
Share on other sites
SCarter

It is the directory where there programs are being called.  Both ids have the access to the programs.   I tried the program hardcoded too.

Share this post


Link to post
Share on other sites
SCarter

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.

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  

×