Posted by: Yesai June 9, 2009
Batch File -- Sys Admins please help
Login in to Rate this Post:     0       ?        

Deleting Folders


Deletes the folder C:\Scripts.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("Select * from Win32_Directory where Name = 'c:\\Scripts'")
For Each objFolder in colFolders
errResults = objFolder.Delete
Wscript.Echo errResults
Next





In .cmd file

cscript scripts.vbs




It should work
Read Full Discussion Thread for this article