>Is there a way to rename a directory (ie simulate the right click->rename in win 95 98. Can it be done from inside VFP? can it be done in a the batch/icon file that calls up a VFP app?
>
>
>TIA
Christopher,
This can be done via the Windows Script Host (from either inside VFP or from a VBScript file, which is the Windows equivalent of an old style DOS batch file). Or it can be done via the Win32API call MoveFile(). Here's a sample of both
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFolder = oFSO.GetFolder("C:\OldName")
oFolder.Name = "NewName"
DECLARE INTEGER MoveFile IN Win32API;
STRING @lpcurrentname, STRING @lpnewname
lcOld = "C:\OldName"
lcNew = "C:\NewName"
llresult = (MoveFile(@lcOld, @lcNew) # 0)
George
Ubi caritas et amor, deus ibi est