Jump to content

Simple Question: RunAsSet


 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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

;)

Link to comment
Share on other sites

  • Developers

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

:)

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

Link to comment
Share on other sites

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? ;)

Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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!

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...