Discussion Locked

login script with runas command

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an application for a user that requires certain network drives to be mapped. I know with runas I can specify the profile the process will use. Is there any way using the runas command I can have the process "execute" the login script or something similiar so when the process runs it has access to the same drive mappings as when the user actually runs the process?

1 reply

by joseph moore

I'm sorry, but it is late Friday evening for me, I am tired, it has been a long week, and your question is not making much sense.
What are you trying to do, exactly? Are you asking how to map drives like USERX when USERY runs the app?
If so, then you can do this from withing a BAT file. You can use the NET USE command with the /U switch to specify a username/password to mape the drives as.

For example, when BOB is logged in, he can run a script that maps drive G to \\SERVER1\SHARE1. Normally, it looks like this:

NET USE G: \\SERVER1\SHARE1

Now,that will run with BOB's permissions. Now, say that BOB wants to map the drive, but use TOM's account, since TOM has more rights then BOB. Now, the security issues asside, it would be done like this:

NET USE G: \\SERVER1\SHARE1 /U:DOMAINNAME\TOM "TOM's password"

That's it.

This discussion is closed to new replies.