Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro Command to rename a directory
Message
 
To
10/04/2003 10:15:17
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00776036
Message ID:
00776063
Views:
17
>Is there a foxpro command that will let me rename a directory ?
>
>Thanks for you help
>Stephen J. Hunt

Stephen,

There isn't a FoxPro command, but there are ways to do it within Fox
* FUNCTION RenDir.prg
* AUTHOR: George Tasker
* DATE: July 2, 1998 - 1:38 PM
* PURPOSE: Renames a directory

LPARAMETERS pcoldname, pcnewname

DECLARE SHORT MoveFile IN Win32API;
   STRING @lpcurrentname, STRING @lpnewname
LOCAL lcoldname, lcnewname, llresult
lcoldname = pcoldname
lcnewname = pcnewname
llresult = (MoveFile(@lcoldname, @lcnewname) # 0)
RETURN
However, the Windows Script Host's Scripting.FileSystem object can do the same thing.
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFolder = oFSO.GetFolder(< fully qualified name >)
oFolder.Name = lcnewname
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform