Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filesearch
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01330920
Message ID:
01330960
Views:
21
Another option is to use the Windows scripting host

It's been a while since I played around with it, but below is some sample code:
You'll need to modify the paths
	* Folders
	
	
	PUBLIC ;
		lLoFSO, ;
		loFolder, ;
		loSubFolder
		
	loFSO = CREATEOBJECT("scripting.filesystemobject")
	lcPath = "C:\"

	IF loFSO.FolderExists(lcpath)
		loFolder = loFSO.GetFolder(lcPath)

		WITH loFolder
			? "Path", .Path
			? CHR(9) + "Is Root?", .IsRootFolder
			? CHR(9) + "Name", .Name
			? CHR(9) + "ParentFolder", .ParentFolder
			? CHR(9) + "ShortName", .ShortName
			
			FOR EACH loSubFolder IN loFolder.SubFolders
				
				WITH loSubFolder
					? "Path", .Path
					? CHR(9) + "Is Root?", .IsRootFolder
					? CHR(9) + "Name", .Name
					? CHR(9) + "ParentFolder", .ParentFolder.Path
					? CHR(9) + "ShortName", .ShortName
				ENDWITH
				
			ENDFOR
		ENDWITH		
	ENDIF



	CLEAR
	
	* 	Files

	PUBLIC 			;
		loFSO, 		;
		loFolder, 	;
		loFile
		
	loFSO = CREATEOBJECT("scripting.filesystemobject")
	lcPath = "C:\Documents and Settings\___\My Documents\"

	IF loFSO.FolderExists(lcpath)
		loFolder = loFSO.GetFolder(lcPath)

		FOR EACH loFile IN loFolder.Files

			WITH loFile
				? "Name", .Name
				? CHR(9) + "Date Created", .DateCreated
				? CHR(9) + "Date Last Accessed", .DateLastAccessed
				? CHR(9) + "Date Last Modified", .DateLastModified
				? CHR(9) + "Path", .Path
				? CHR(9) + "ShortName", .ShortName
				? CHR(9) + "ShortPath", .ShortPath
				? CHR(9) + "Size", .Size
				? CHR(9) + "Type", .Type			
			ENDWITH
		
		ENDFOR
				
	ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform