Dry the surfaces around the open window immediately after you realize the window was left open. Use old towels and rags to wipe the wood and plastic around the window until it is completely dry. Make sure the nooks and crannies around the window are also completely dry.
Fill a spray bottle with one part vinegar and one part water. Spray the window area with the solution and wipe it down with old rags. Dry with old towels. The vinegar will do a good job at ridding the area of the musty smell.
Place a fan near the area where the window was left open. Face it toward the window and turn it on full blast. Leave it on for a few hours. The air from the fan will dry the window area thoroughly.