VO2 and V2O3 thin films were prepared during in situ XRD investigation by oxidation and reduction of V and V2O5. Films show up to 5 orders of magnitude resistance switching.