Posted on 2011-05-02
I need to delete a file on the root of C: on my servers. Simple enough. Problem is, my servers are a mixture of WinXP (small app servers) as well as W2K3 Server. Any idea how I can delete the file from my servers? Can I reference all computer accounts in my Servers OU in AD? Can I create a txt file of all the server names/computer accounts and reference that? Though I can fenagle my way through a script to kinda see what it's doing, I am by no means a scripter at all. I have code that I've...(cough) borrowed to use. :) The below is what I have:
Dim objFileSys, objDelFile, strFilePath
strFilePath = "C:\FileName.extension"
Set objFileSys = CreateObject ("Scripting.FileSystemObject")
If objFileSys.FileExists(strFilePath) Then
objFileSys.DeleteFile strFilePath, True
Set objFileSys = Nothing
Set objDelFile = Nothing
Set strFilePath = Nothing
My problem is the beginning part of the script. I don't know how to call/reference my servers. Thanks in advance for your assistance!