An information processing apparatus operable in one of a plurality of modes including a first setting mode in which Wi-Fi communication is enabled and a second setting mode in which Wi-Fi communication is disabled, the apparatus comprising: a near field communication "NFC" unit configured to perform short range wireless communication; wireless communication means configured to perform Wi-Fi communication with an external device; acquisition means configured to acquire, via the NFC unit, connection information including at least an SSID of an access point; establishment means configured to establish a Wi-Fi communication connection based on the connection information, upon acquisition of the connection information by the acquisition means; characterized by further comprising: first change means configured to perform first change processing for automatically changing a setting mode to the first setting mode before the Wi-Fi communication connection is established in a case where the setting mode when the connection information is acquired by the acquisition means is the second setting mode (Yes in S603); storage means configured to store flag information indicating the setting mode when the connection information is acquired by the acquisition means; and second change means configured to: perform second change processing for automatically changing the setting mode to the second setting mode in response to a predetermined time period having elapsed since communication is last performed via the established Wi-Fi communication connection (YES in S706) in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the second setting mode (YES in S707); and not perform the second change processing in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the first setting mode (NO in S707). a near field communication "NFC" unit configured to perform short range wireless communication; wireless communication means configured to perform Wi-Fi communication with an external device; acquisition means configured to acquire, via the NFC unit, connection information including at least an SSID of an access point; establishment means configured to establish a Wi-Fi communication connection based on the connection information, upon acquisition of the connection information by the acquisition means; characterized by further comprising: first change means configured to perform first change processing for automatically changing a setting mode to the first setting mode before the Wi-Fi communication connection is established in a case where the setting mode when the connection information is acquired by the acquisition means is the second setting mode (Yes in S603); storage means configured to store flag information indicating the setting mode when the connection information is acquired by the acquisition means; and second change means configured to: perform second change processing for automatically changing the setting mode to the second setting mode in response to a predetermined time period having elapsed since communication is last performed via the established Wi-Fi communication connection (YES in S706) in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the second setting mode (YES in S707); and not perform the second change processing in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the first setting mode (NO in S707). first change means configured to perform first change processing for automatically changing a setting mode to the first setting mode before the Wi-Fi communication connection is established in a case where the setting mode when the connection information is acquired by the acquisition means is the second setting mode (Yes in S603); storage means configured to store flag information indicating the setting mode when the connection information is acquired by the acquisition means; and second change means configured to: perform second change processing for automatically changing the setting mode to the second setting mode in response to a predetermined time period having elapsed since communication is last performed via the established Wi-Fi communication connection (YES in S706) in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the second setting mode (YES in S707); and not perform the second change processing in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the first setting mode (NO in S707). perform second change processing for automatically changing the setting mode to the second setting mode in response to a predetermined time period having elapsed since communication is last performed via the established Wi-Fi communication connection (YES in S706) in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the second setting mode (YES in S707); and not perform the second change processing in a case where the flag information indicates that the setting mode when the connection information is acquired by the acquisition means is the first setting mode (NO in S707).