Forum Discussion
tristaanogre
13 years agoEsteemed Contributor
For all your cases in your function where you are calling RD to rename a directory, you would use:
You don't need anything fancy around that, just simply send in the old name of the folder with it's full path and then give it the new name, also with the full path.
As for renaming files, it's also very much the same sort of thing.
So, if I'm reading your code correctly, the first 10 lines of your code would be replaced as such:
Hope this helps.
As for your other request, look at using aqFile.ReadWholeTextFile and then using the aqString.Replace against that result. Then use aqFile.WriteToTextFile to output the result back to your file.
call aqFileSystem.RenameFolder("C:\OldName", "C:\NewName")
You don't need anything fancy around that, just simply send in the old name of the folder with it's full path and then give it the new name, also with the full path.
As for renaming files, it's also very much the same sort of thing.
call aqFileSystem.RenameFile("C:\MyFolder\OldName.txt", "C:\MyFolder\NewName.txt")
So, if I'm reading your code correctly, the first 10 lines of your code would be replaced as such:
' Rename folder LG Componentes and files.sql
aqFileSystem.RenameFolder("D:\Scripts\Scripts\01 - LGComponentes", "D:\Scripts\Scripts\1.LGComponentes")
aqFileSystem.RenameFolder("D:\Scripts\Scripts\1.LGComponentes\SQL Server", "D:\Scripts\Scripts\1.LGComponentes\SQLServer")
aqFileSystem.RenameFile("D:\Scripts\Scripts\1.LGComponentes\SQL Server\1.LGComponentes_CREATE_SQL_SERVER.sql", "D:\Scripts\Scripts\1.LGComponentes\SQL Server\1.SQL")
Log.Message("Folder 1.LGComponentes renamed")
Hope this helps.
As for your other request, look at using aqFile.ReadWholeTextFile and then using the aqString.Replace against that result. Then use aqFile.WriteToTextFile to output the result back to your file.
Related Content
Recent Discussions
- 9 hours agod_gfleetwood92
- 10 hours agoFFCB