Method: AutoItX3.run_as_set

Defined in:
lib/AutoItX3/process.rb

.run_as_set(username, domain, password, options = 1) ⇒ Object

Changes the the owner of following #run and #run_and_wait methods to the given user.

Parameters

username

The name of the user you want to run commands as.

domain

The user’s domain.

password

The user’s password.

options

(1) One of the following: 0: don’t load the user profile, 1 (default): load the user profile, 2: Only for networking.

Return value

nil.

Raises

NotImplementedError

You’re using Windows ME or earlier which don’t support this method.

Example

AutoItX3.run_as_set("Rubyist", "WORKGROUP", "MyFamousUncrackablePassword")
AutoItX3.run("hack_them_all.exe")


192
193
194
195
196
197
198
# File 'lib/AutoItX3/process.rb', line 192

def run_as_set(username, domain, password, options = 1)
  @functions[__method__] ||= AU3_Function.new("RunAsSet", 'SSSI', 'L')
  if @functions[__method__].call(username.wide, domain.wide, password.wide, options) == 0
    raise(NotImplementedError, "Your system does not support the #run_as_set method.")
  end
  nil
end