Page 1 of 1
Rename a directory
Posted: Sun Apr 22, 2018 5:11 pm
by hmgchang
Hi everyone....
Any function to rename a directory ?
Or how to do it with hmg coding ?
Tia
Best rgds
Chang
Re: Rename a directory
Posted: Sun Apr 22, 2018 8:12 pm
by Carlos Britos
Hi Chang
FRename( cOldFile/folder, cNewFile/folder )
Do not end a file or directory name with a space or a period.
Although the underlying file system may support such names, the Windows shell and user interface does not.
Directory names are stored by the file system as a special type of file, but naming rules for files also apply to directory names.
Carlos
Re: Rename a directory
Posted: Mon Apr 23, 2018 12:15 pm
by mustafa
Hi Chang
Carlos Britos best option
another alternative option
xange1 := "C:\Test\New_Folder1"
xange2 := "C:\Test\New_Folder2"
FRENAME( xange1 , xange2 )
RENAME &xange1 TO &xange2
Regards
Mustafa
Re: Rename a directory
Posted: Wed May 02, 2018 6:34 am
by hmgchang
Thanks Mr. Carlos and Mr. Mustafa
It works as suggested...
My problem is :
I need to rename the current directory
any suggestions
TIA
best rgds
Chang
Re: Rename a directory
Posted: Wed May 02, 2018 9:43 am
by Anand
Chang, if you are running the exe from current directory or any file opened in current directory, win os will not allow you to rename the current directory.
Regards,
Anand