Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cancellare cartelle

8 views
Skip to first unread message

Sergio

unread,
Aug 21, 2005, 6:06:10 AM8/21/05
to

Scusate la mia ignoranza,ma vorrei sapere perche
usando questo semplice VBS per cancellare una cartella,
non sempre la cosa funziona.Alcune cartelle le cancella e altre no
dando come errore " AUTORIZZAZIONE NEGATA".
Non sono riuscito a identificare il tipo di cartelle che non
riesce a cancellare.So che non dipende dagli attributi e
nemmeno da quanto e' contenuto nella cartella.

Ecco il VBS che sto cercando di usare:

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder ("C:\Documenti\Foto")

Se qualcuno mi spiega dove sto sbagliando mi fara'
un grande piacere.
Grazie anticipate e saluti a tutti.

Sergio

Fosco

unread,
Oct 28, 2005, 10:27:34 PM10/28/05
to
"Sergio"

> Ecco il VBS che sto cercando di usare:
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> objFSO.DeleteFolder ("C:\Documenti\Foto")

IMHO dipende proprio dagli attributi e dal sistema operativo
Ovviamente čper esempio XP non ti permette di cancellare
una cartelle che ritiene vitale (p.e. di sistema)

DeleteFolder Method
Deletes a specified folder and its contents.

object.DeleteFolder ( folderspec[, force] );
Arguments
object
Required. Always the name of a FileSystemObject.
folderspec
Required. The name of the folder to delete. The folderspec can contain wildcard characters in the last path component.
force
Optional. Boolean value that is true if folders with the read-only attribute set are to be deleted; false (default) if
they are not.


Potresti provare col force ma ATTENZIONE a memoria il .DeleteFolder
NON passa dal cestino
--
Fosco


0 new messages