I currenly have a HTA that has alot of code. Part of the code displays a pop up message with the usersname to confirm we are working with the correct client. I Couldnt use WMI since all of our laptops block WMI quiries so I had to get inventive. All computers here have a default share. The script below
1. Pings the COMPUTERDNSNAME, If there is a reply 2. it reads the contents of the following \" & strComputer & "sic_c$Documents and Settings 3. If folder has been modifed in last 14 days it list the items in a popup box This acts as a conformation that the computername wasnt fatfigured, WMI would be alot better but not a option as they are not going to reconfigure the image firewall rules just for WMI to be active. I want to change the Last day to (100) since some of these PC dont have that folder writen to everyday.
So now my question. Is there anyway I can Exclude folder names from being listed? There are some accounts that show up in the list that I like to not show up. Such as NetworkService, XPRollout, All Users, Administrator ETC
SO is there a way i can EXCLUDE listing folders that = NetworkService, XPRollout, All Users, Administrator ETC
Here is a snippit of my code
Dim strComputer Dim WShell Dim fso, f, f1, fc, s, oLast Dim Msg
Sub Get_Login_Details strComputer = txt_computer.value if strComputer = "" Then msgbox "Please enter a computer name or IP Address",vbOKOnly,"No Computer Name or IP Address" Exit Sub End If If Ping(strComputer) = False Then msgbox strComputer & " did not respond to ping. No action could be taken.",vbOkOnly, "Cannot continue script." Exit Sub End If Set WShell = CreateObject("WScript.Shell")
oLast = DateAdd("d", -14, Now)
msgbox "Users who have logged on " & strComputer & " since " & oLast & ":" & vbCrLf & ShowFolderList("\" & strComputer & "sic_c$Documents and Settings") & vbcrlf & vbcrlf & vbcrlf & _ "Note: If no users are listed just insure you typed in the correct SIC#" & vbcrlf & vbcrlf
function ShowFolderList(folderspec) Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(folderspec) Set fc = f.SubFolders For Each f1 In fc If DateValue(f1.DateLastModified) >= oLast Then s = s & f1.name s = s & VbCrLf End If Next ShowFolderList = s set WShell = Nothing End Function
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!