/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
directory problems
Fra : asd987


Dato : 13-05-04 20:34

Hi,

Ihave 2 small questions:

1. Is the only way to deltet a directory including the files in that
directory to first chdir to directory, then remove all the files and at last
rmdir the directory? Or is there something lijke the UNIX-command rm -r *

2. How can I determine the size of a directory? Like in the prperties of a
directory where the size is diplayed in MB.

Thanks.



 
 
Morten W. Nissen (13-05-2004)
Kommentar
Fra : Morten W. Nissen


Dato : 13-05-04 21:56

> 1. Is the only way to deltet a directory including the files in that
> directory to first chdir to directory, then remove all the files and at
last
> rmdir the directory? Or is there something lijke the UNIX-command rm -r *

In this case you need to destroy the folder and create it again.

dim fso as new filesystemobject
dim pathTofolderToNuke as string
pathTofolderToNuke = "c:\winnt"

fso.deletefolder(pathTofolderToNuke ,true)
fso.createfolder pathTofolderToNuke

The true tells fso to force, and dont care about readonly files etc.

After this the folder is

> 2. How can I determine the size of a directory? Like in the prperties of a
> directory where the size is diplayed in MB.
>

Here i guess you need to make a collection of files and then sum up the
size.

Regards,
Morten



Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408875
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste