Note: You are looking at a static snapshot of documentation related to Robot Framework automations. The most recent documentation is at https://robocorp.com/docs

RPA.Desktop.OperatingSystem

OperatingSystem is a cross-platform library for managing computer properties and actions.

Examples

Robot Framework

*** Settings *** Library RPA.Desktop.OperatingSystem *** Tasks *** Get computer information ${boot_time}= Get Boot Time as_datetime=${TRUE} ${machine}= Get Machine Name ${username}= Get Username &{memory}= Get Memory Stats Log Many ${memory}

Python

from RPA.Desktop.OperatingSystem import OperatingSystem def get_computer_information(): ops = OperatingSystem() print(f"Boot time : { ops.get_boot_time(as_datetime=True) }" f"Machine name : { ops.get_machine_name() }" f"Username : { ops.get_username() }" f"Memory : { ops.get_memory_stats() }") if __name__ == "__main__": get_computer_information()