list system files

  • Thread starter Thread starter greg chu
  • Start date Start date
G

greg chu

If I type dir /s in the command line prompt I can list all system files
ex.
get into the IE temporary files

C:\Documents and Settings\XXXXXX\Local Settings\Temporary Internet
Files

XXXXXX is a user name of the system

then do a dir /s

But I need to use VB.net to list all system files. I could not find
anything about it. use filesysteminfo or ?????

Please help!

Thanks!

Greg
 
Greg,

I believe that dir /AS lists system files.

At any rate, to list the system files in a particular directory using VB.Net:

Dim di As New DirectoryInfo("c:\temp")
Dim fi As FileInfo

For Each fi In di.GetFiles
If fi.Attributes And FileAttributes.System Then
MsgBox(fi.FullName)
End If
Next

Kerry Moorman
 
If I browse the internet files using IE -> tools -> internet options ->
settings, I see lots of temperary files. But if I use vb.net as shown
above, I only see 1 file.

Any clue?

Thanks!

Greg
 
greg chu said:
If I browse the internet files using IE -> tools -> internet options ->
settings, I see lots of temperary files. But if I use vb.net as shown
above, I only see 1 file.

Any clue?

You're only looking for system files and there is usually only one
system file in the Temporary Internet Files folder: desktop.ini

Note that in a command shell, we normally use DIR /AS to list
system files. DIR /S actually lists all the files in the directory AND
its subdirectories.

Type DIR/? for full syntax
 
Back
Top