Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RD blows up on non-empty folders
Message
 
To
17/09/2012 15:52:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01553085
Message ID:
01553095
Views:
60
>With this little function you can easily change the attributes of your files, to not hidden in this case. A simple loop with adir() and this function will make every file visible.
>FUNCTION SetAttr
>PARAMETER tFileName, tAttribute
>tAttribute = UPPER(tAttribute)
>Private nAttribute
>nAttribute=0
>If 'S'$tAttribute && System
>   nAttribute = nAttribute + 4
>Endif    
>If 'H'$tAttribute && Hidden
>   nAttribute = nAttribute + 2
>Endif    
>If 'R'$tAttribute && ReadOnly
>   nAttribute = nAttribute + 1
>Endif    
>If 'A'$tAttribute && Archive
>   nAttribute = nAttribute + 32
>Endif    
>If 'N'$tAttribute && Normal
>   nAttribute = nAttribute + 128
>Endif    
>declare integer SetFileAttributes IN kernel32 STRING, INTEGER 
>Return SetFileAttributes(tFileName,nAttribute)=1
>
>>Hi Gang!
>>
>>If a folder is not empty, but has hidden files in it, what is the easiest way to REMOVE THIS FOLDER with VFP commands?? (If you try the following command, it throws an ERROR, since the folder is not empty).
>>
>>RD C:\PHARMACY\DOWNLOAD\DISK1\ and it has hidden files in it ??
>>
>>Thanks!
>>
>>PS.... if you use something other than VFP, can I be assured it will work with Windows 7 and 8 ??

Thanks!
Tommy Tillman A+ NetWork+ MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform