The sentence inside the quotation marks ("Open the window.") is an imperative sentence (a command, request, or order). Converting an imperative sentence from direct to indirect speech follows specific rules:
Changing the Reporting Verb: The reporting verb "said to" changes into an appropriate verb like ordered, requested, asked, or "told" depending on the context. Here, it transforms to "told me".
Connecting the Clauses (The Infinitive Rule): Unlike assertive sentences which use the conjunction "that", imperative sentences drop the quotation marks and use an infinitive structure (\text{to} + \text{verb}) to connect the reporting clause to the reported speech.
Combining these rules gives us the seamless and correct sentence: She told me to open the window.