Jump to content

RunAsSet and network credentials


Guest Emptysevenfive
 Share

Recommended Posts

Guest Emptysevenfive

Hi, I am very new to AutoIt, I have a couple of programs that need to be run with local admin rights, but the users data files are on their mapped net drives.

doing a;

RunAsSet("Administrator", @Computername, "password", param)

Runwait("c:\program\program.exe")

runasset()

This runs the program but when the student trys to open their files from n:\ it gives unknown user since administrator has no rights.

I have searched forums but not found any clear solutions.

Anything to do with drivemapadd and unc paths , or have one script call another??

I would very much appreatiate a code segment as i said im very new to scripting.

Thanks.

Link to comment
Share on other sites

Hi,

When using RunAsSet always use Unc paths because the drives are not mapped !!!!

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

Guest Emptysevenfive

thanks,

I have been trying to use the drivemapadd to mapp a drive to the unc path, but this doesn't seem to work.

I am also looking into using send keys to open a dummy project using the unc path.

This then displays a enter network password box.

Is it possible to find the currently logged on user password to that i can totaly automate this.

I have also been trying to use winwait, but it cant see the network password box.

I have to reconnect drive mappings to two different servers. \\studentserver\stuid

and \\staff\coursefiles etc.

my script so far :

-------

Dim $studentusername, $studentpasswd, $studentdomain, $studenthomeshare, $studentdrive

$studentusername = @UserName

$studentdomain = @LogonDomain

$studenthomeshare = @HomeShare

$studentdrive = @HomeDrive

;DriveMapAdd ("", "\\poppy\studid", 8, "ntnet\studid" )

; Set the RunAs parameters to use local adminstrator account

RunAsSet("Administrator", @Computername, "password", 0)

; Run editor as admin

Run("c:\estudio\estudio.exe")

Sleep(50)

winactivate ( "Crossware Embedded Development Studio" )

Send ( "{ENTER}" )

Send ( "!f" )

Send ( "^o" )

Send ( $studenthomeshare )

Send ( "!o" )

Sleep (25)

Send( $studentdomain )

Send ( "\" )

Send ( $studentusername )

#cs

winwait ("Enter Network Password")

winclose ("open")

Sleep (25)

winactivate ( "Crossware Embedded Development Studio" )

Send ( "!f" )

Send ( "^o" )

Send ( "\\salt\public" )

Send ( "!o")

Sleep (25)

Send( $studentdomain )

Send ( "\" )

Send ( $studentusername )

#ce

; Reset user's permissions

RunAsSet()

The script doesn't wait until the password box has closed.

The first bit of the script does work and once the password has been entered then the students home directory can once again be accessed via drive letter.

any suggestions would be helpfull.

thanks.

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
 Share

  • Recently Browsing   0 members

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