Rename a directory

Moderator: Rathinagiri

Post Reply
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

Rename a directory

Post by hmgchang »

Hi everyone....
Any function to rename a directory ?
Or how to do it with hmg coding ?

Tia
Best rgds
Chang
Just Hmg It !
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: Rename a directory

Post 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
Regards/Saludos, Carlos (bcd12a)
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Rename a directory

Post 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
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

Re: Rename a directory

Post by hmgchang »

Thanks Mr. Carlos and Mr. Mustafa
It works as suggested...
My problem is :

Code: Select all

FRename( "..\abc", "..\def")
I need to rename the current directory

any suggestions
TIA
best rgds
Chang
Just Hmg It !
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: Rename a directory

Post 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
Regards,

Anand

Image
Post Reply