Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Size of Directory
Message
From
10/08/2002 10:25:04
 
 
To
10/08/2002 09:49:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00688118
Message ID:
00688298
Views:
20
>I am having problems using the GetFolder method. When I create an Instance using GetFolder an try to get the name of the SubFolders using the function Item() I get the error: 'Incorrect Number of Parameters'. I read the MSDN and the function dont have any parameters. Did you have this problem too ?
>

Try:
oFSO = CREATEOBJ('Scripting.FileSystemObject')
oFolder=oFSO.GetFolder('C:\MyTopFolder')
IF oFolder.SubFolders.Count > 0
   FOR EACH oSubFolder IN oFolder.SubFolders
      WITH oSubFolder
         ? .Name,.Path,.Files.Count,.SubFolders.Count  && each oSubFolder is a Folder Object
      ENDWITH
   ENDFOR
ELSE
   ? 'There are no subfolders!'
ENDIF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform