Page 1 of 1

Rename a windows file

Posted: Thu Feb 28, 2019 3:04 am
by WesleyWest
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..

Re: Rename a windows file

Posted: Thu Feb 28, 2019 8:56 am
by odklizec
Hi,

You can use this .net method to rename files...
System.IO.File.Move(oldfilename,newfilename);

Re: Rename a windows file

Posted: Thu Feb 28, 2019 1:31 pm
by WesleyWest
Works like a charm! Thank you very much!