I need a Batch or VBS Script that will look for *.nsf and then get the Modified Date from that file and then dump computer name and date to a text file
I am in need of a batch OR vbs script that will Search a Lotus Notes DIrectory looking for a location of *.nsf. There will only be one file labeld .nsf in this folder but it is named differently on each computer. I also need the script write to a text file and then write the computer name the modified date into a text file, as well as write to another text file if the the path doesn't exist. I have code that I have put together but it doens't allow me to search for Wildcards i.e *.nsf. If you need more information let me know. Also see my script and it should explain more.
OPTION EXPLICITConst ForAppend = 8DIM objFSO, objNet, objFileDIM strPath, compName, strDiff, loFile, ldLaststrPath = "C:\Program Files\lotus\notes\data\mail\*.nsf"SET objNet = CreateObject("WScript.NetWork")compName = objNet.ComputerNameSET objFSO = CreateObject("Scripting.FileSystemObject")IF objFSO.FileExists(strPath) THEN SET loFile = objFSO.GetFile(strPath) ldLast = loFile.DateLastModified strDiff = DateDiff("d",ldLast,DATE) IF strDiff < 2 THEN SET objFile = objFSO.OpenTextFile("recentusernsf.txt", ForAppend, True) objFile.writeLine(compName & " *.nsf Does Exist " & ldLast) ELSE SET objFile = objFSO.OpenTextFile("olderthan2usernsf.txt", ForAppend, True) objFile.writeLine(compName & " *.nsf Does Exist " & ldLast) END IFELSE SET objFile = objFSO.OpenTextFile("noexistusernsf.txt", ForAppend, True) objFile.writeLine(compName & " *.nsf does not exist ")END IFSET objFile = NOTHINGWScript.Quit
It may require some tweaking, so let me know if you need something changed.
As-is it searches drives C: & E: for NSF files and reports the info to C:\NSFsFound.txt
Open in new window