Module: Uac

Defined in:
lib/uac.rb

Defined Under Namespace

Modules: Shell32 Classes: UacPrivate

Class Method Summary collapse

Class Method Details

.shell_execute(options, args) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/uac.rb', line 93

def self.shell_execute options, args
  uac_private = UacPrivate.new

  (file, rest) = uac_private.join_args options, args

  verb = options[:verb] || "runas"

  Shell32.ShellExecuteA(
    nil,
    FFI::MemoryPointer.from_string(verb),
    FFI::MemoryPointer.from_string(file),
    FFI::MemoryPointer.from_string(rest),
    FFI::MemoryPointer.from_string(Dir.pwd),
    Shell32::SW_SHOWNORMAL)
end