require 'Win32API' # http://msdn.microsoft.com/en-us/library/aa373201(v=vs.85).aspx setSuspendState = Win32API.new('powrprof.dll', 'SetSuspendState', %w(i i i), 'i') setSuspendState.call(0, 0, 0)