Class: Vmopt::PowerOperation

Inherits:
Object
  • Object
show all
Defined in:
lib/vmopt/power_operation.rb

Instance Method Summary collapse

Instance Method Details

#lock_userObject

参数:无功能:锁定或切换用户返回值:默认



39
40
41
# File 'lib/vmopt/power_operation.rb', line 39

def lock_user
  system("rundll32.exe user32.dll LockWorkStation")
end

#logoffObject

参数:无功能:注销返回值:默认



29
30
31
# File 'lib/vmopt/power_operation.rb', line 29

def logoff
  system("shutdown -l")
end

#rebootObject

参数:无功能:重启返回值:默认



19
20
21
# File 'lib/vmopt/power_operation.rb', line 19

def reboot
  system("shutdown -r -t 00")
end

#shutdownObject

参数:无功能:关机返回值:默认



10
11
12
# File 'lib/vmopt/power_operation.rb', line 10

def shutdown
  system("shutdown -s -t 00")
end

#sleepObject

参数:无功能:休眠,xp没有休眠的功能,win7有休眠的功能返回值:默认



48
49
50
# File 'lib/vmopt/power_operation.rb', line 48

def sleep
  system("rundll32.exe powrprof.dll SetSuspendState")
end