Sign in to follow this  
Followers 0
eagletempest

RunasSet on a mapped drive

2 posts in this topic

I want to run a custom application on a mapped Q drive with special user credentials.

The current user already has a Q drive mapped to the proper share.

So I have:

RunAsSet('umapfm', 'umadomain','$3221fby')

If DirGetSize("Q:\PFM") == - 1 Then

MsgBox(0,"Error",@error)

Else

Run(@COMSPEC & ' /c ' & "Q:\PFM\PFMEdtior.exe")

EndIf

This script is actually stored in Q:\PFM so I've also tried.

Run(@COMSPEC & ' /c ' & @Scriptdir & "\PFMEdtior.exe")

I receive an "Unable to execute the external program. The directory name is invalid" error.

Any ideas? Thanks.

Share this post


Link to post
Share on other sites



Since you are doing a RunAsSet the special user does not have the Q: mapped so that is the reason for the error. The way to think of it is Windows is logging that user in and since it is a different user it does not have it mapped. So, you either need to map the Q: under the other user (using run with net commands after the RunAsSet) or using the option of 0 in the RunAsSet might work.

Example:

RunAsSet('umapfm', 'umadomain','$3221fby', 0)

Not sure if this will work as not able to test it.

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