I have included my code below.  This is my first experience trying to use
COM objects in PHP.  My problem is that the
foreach loop does not output anything, regardless of whether or not there
are files in the folder.  Can anyone tell me what is wrong with my script?
Thanks for any help.

                   Kyle





<?php

 session_start();

 $objPath = "C:\\" . $_SESSION['user'] .  "\\";

 print $objPath;

 $objFileManager = new COM("Scripting.FileSystemObject") or die("cant open
COM object");

  if ($objFileManager->FolderExists($objPath))
  {
           print "folder exists";

           $objFolder = $objFileManager->GetFolder($objPath);

           $objFolder->Path;

           $fileCollection = $objFolder->Files;


           foreach ( $fileCollection as $file ){

                print $file->Path;
           }

  }
  else
       print "doesnt exist";


?>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to