Get the App
SLTechnology News&Howtos  ›  Development  › 

The use of DeleteFolder method in VBS

Shulou Source: shulou.com Published: 2022-06-03 19:40:30 11月12日 Update

This article mainly introduces "the use of DeleteFolder method in VBS". In daily operation, I believe many people have doubts about the use of DeleteFolder method in VBS. I have consulted all kinds of materials and sorted out simple and easy operation methods. I hope to help you answer the doubts about "the use of DeleteFolder method in VBS"! Next, please follow the small series to learn together!

Delete the specified folder and its contents.

object.DeleteFolder folderspec[, force]

Parameter object

Required. Expected name of FileSystemObject.

folderspec

Required. The name of the folder to delete. folderspec can contain wildcards in the last component of the path.

force

Optional. Boolean value. True if you want to delete a read-only folder; False otherwise (default).

description

The DeleteFolder method does not distinguish whether a folder contains content or not. The folder is deleted regardless of whether it contains content.

If no matching folder is found, an error occurs. The DeleteFolder method stops on the first error that occurs. This method does not undo any changes made before the error occurred.

The following example illustrates how to use the DeleteFolder method:

Sub DeleteAFolder(filespec) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFolder(filespec)End Sub This is the end of the study on "Use of DeleteFolder Method in VBS". I hope you can solve your doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Tags: Methods files folders learning content errors names more help practical next examples parameters articles theory knowledge articles components websites materials Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Huawei Shulou Information Docker