Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
The Delete method lets you delete instances of a managed resource. Not all WMI classes support the Delete method; those that do include Win32_Directory, CIM_DataFile, Win32_Share, and Win32_ScheduledJob. This means that you can use scripts to delete files, folders, shared folders, or scheduled tasks.
To delete a managed resource, retrieve the instance to be deleted, and then call the Delete method. The script template in Listing 6.28 demonstrates this operation by deleting the shared folder named "New Share Name."
Listing 6.28 Template for Deleting Resources
|
|
To use this template to delete other managed resources:
Send us your feedback | « Previous | Next » |