Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

vb scipt that cleans up directories and files

$
0
0

I was wondering if anyone could help me out with this script. I would like to delete 2 folders (+ sub folders and data) and 1 file that is located in the root of C:\

I just need to build some logic into this. This will be deployed using GPO. When I run it the first time it works, but if you re-boot the workstation it errors out as the files aren't there anymore.

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\MININT")

objFolder.Delete

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\_SMSTaskSequence")

objFolder.Delete

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\LTIBootstrap.vbs")

objFile.Delete

ZT


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>