Jump to content
Sign in to follow this  
Alex Lau

Simple Question: RunAsSet

Recommended Posts

Alex Lau

Why this script does not work?

RunAsSet('administrator', 'afdasdfa', 'dfasdfasdf')
DriveMapAdd("V:", "\\172.16.50.44\temp")
FileChangeDir("V:")
Run("vnc.exe")

Error: Unable to execute the external program.

:)

Edited by Alex Lau

Share this post


Link to post
Share on other sites
Jos

The driveMapAdd() runs with the normal credentials NOT the RunAsSet() credentials and thus is the maped drive not available to the Run Command.

Remarks

This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator). The function only works on the 2000/XP (or later) platforms. NT4 users should install and use the SU command from the NT Resource Kit.

:)


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Alex Lau

The driveMapAdd() runs with the normal credentials NOT the RunAsSet() credentials and thus is the maped drive not available to the Run Command.

:)

Thank you.

So, how can i finish this script? I would like to install a VNC client software, and the VNCsetup.exe file on \\server\share

;)

Share this post


Link to post
Share on other sites
Alex Lau

copy the file to a local directory first and then run the installer with the elivated credentials ..

:)

Yes, i made a test with your way and successfully, but many PC need to install VNC, I want to write a script for ONE CLICKE install without COPY anything....

No way? ;)

Share this post


Link to post
Share on other sites
Jos

Yes, i made a test with your way and successfully, but many PC need to install VNC, I want to write a script for ONE CLICKE install without COPY anything....

No way? ;)

I don't understand your issue. To me it is the same thing when you copy the file first and then run it and delete it, because when doing a Run() for the program from the server, the file still needs to be loaded into memory thus copied from the server. :)

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Alex Lau

RunAsSet('administrator', 'asdfasdf', 'asdfasdf')

RunWait("\\server\vnc.exe")

......

Is this OK???

:)

Share this post


Link to post
Share on other sites
Jos

RunAsSet('administrator', 'asdfasdf', 'asdfasdf')

RunWait("\\server\vnc.exe")

......

Is this OK???

;)

when using an account that has acces to the server : Yes

One thing to rememebr though is that you don't want to use and Domain Admin account in your scripts. I always use a PC admin account without any access to the domain for installing software on "locked down" PC's... :)

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Alex Lau

when using an account that has acces to the server : Yes

One thing to rememebr though is that you don't want to use and Domain Admin account in your scripts. I always use a PC admin account without any access to the domain for installing software on "locked down" PC's... :)

Jos

Thank you very much!

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  

×