Rename a windows file

Download and share automation modules and examples.
WesleyWest
Posts: 3
Joined: Thu Feb 28, 2019 3:00 am

Rename a windows file

Post by WesleyWest » Thu Feb 28, 2019 3:04 am

Hello! I am very new to Ranorex and I am having trouble finding any infomation on Ranorex or even Csharp to rename a file from a module.

So Ultimately I need to rename a file before a recording so I can test the software without the ini file. I will then rename it back to the original name at the end of the test case. Does anyone have any suggestions?

Thanks in Advance..

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4924
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Rename a windows file

Post by odklizec » Thu Feb 28, 2019 8:56 am

Hi,

You can use this .net method to rename files...
System.IO.File.Move(oldfilename,newfilename);
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

WesleyWest
Posts: 3
Joined: Thu Feb 28, 2019 3:00 am

Re: Rename a windows file

Post by WesleyWest » Thu Feb 28, 2019 1:31 pm

Works like a charm! Thank you very much!