Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: namespace missing hidden files!

HTVi
TV Discussion Newsgroups

namespace missing hidden files!
"Mike Azar via WinServerKB.com" <u35365[ at ]uwe> 6/28/2007 2:06:49 AM
I'm using VFP9 and trying to get a list of files / folders of a given
directory. The sample code below works great but is missing hidden files
and filders such as 'Local Settings'. Can you help?

CLEAR

lcDir = [C:\Documents and Settings\Administrator\]

loShell = CreateObject("Shell.Application")
loFolder = loShell.Namespace( lcDir )

For Each lcFileName in loFolder.Items
*--------------------------------------------------
*-- get alternate name
*--------------------------------------------------
lcAltName = loFolder.GetDetailsOf(lcFileName, 0)
lcAltName = STRTRAN(lcAltName,'Shared Documents', 'Documents')

lcAltName = STRTRAN(lcAltName,'Shared Music', 'My Music')
lcAltName = STRTRAN(lcAltName,'Shared Pictures', 'My Pictures')
lcAltName = STRTRAN(lcAltName,'Shared Video', 'My Videos')


lnBegPos = AT(['s],lcAltName)
IF lnBegPos > 0 AND INLIST( ALLTRIM(SUBSTR(lcAltName,lnBegPos + 3, 254)),
'Documents','Music','Pictures','Videos')
lcAltName = ALLTRIM( 'My ' + SUBSTR(lcAltName,lnBegPos + 3, 254))
ENDIF
*--------------------------------------------------

lcFullPath = lcDir + lcAltName

if !directory(lcFullPath,1)
?'Dir not found: ' + lcFullPath
*!* FOR t= 0 TO 34
*!* ? "File name "+STR(t,2)+": "+ loFolder.GetDetailsOf
(lcFileName, t)

*!* next
ELSE
?' found: ' + lcFullPath
ENDIF

NEXT

--
Mike Azar

Message posted via WinServerKB.com
http://www.winserverkb.com/Uwe/Forums.aspx/windows-server-scripting/200706/1

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen