Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move/Rename Directories in VFP
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Move/Rename Directories in VFP
Miscellaneous
Thread ID:
00142543
Message ID:
00142543
Views:
60
I was reading some older threads on renaming directories, and discovered after some experimenting that you can rename them using VFP's rename command. I had no problem issuing the command below under Windows 95. Has anyone tested this on other operating systems?
rename "C:\Outlook 98 Setup." to "c:\the quickbrown fox."
rename "c:\the quickbrown fox." to "C:\Outlook 98 Setup."
I also noticed that rename will move a file across drives/directories if the file does not exist in the destination path. This is documented in help, but has eluded me until now. Since it may not be obvious to another developer, I think when I use this technique I'll use #DEFINE Move_File Rename so that the code would then read: Move_File FileName1 TO FileName2.

You can also move directories on the same drive using this approach:
rename "C:\Outlook 98 Setup." to "c:\temp\the quickbrown fox."
rename "c:\temp\the quickbrown fox." to "C:\Outlook 98 Setup."
Note however, that you can not move a directory from one drive to another.
kenweber
GCom2 Solutions
Microsoft Certified Professional

Next
Reply
Map
View

Click here to load this message in the networking platform