troubleshooting Question

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

Avatar of michaelbarga
michaelbarga asked on
Lotus IBMWindows BatchVB Script
6 Comments1 Solution478 ViewsLast Modified:
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.
Const ForAppend = 8
DIM objFSO, objNet, objFile
DIM strPath, compName, strDiff, loFile, ldLast
strPath = "C:\Program Files\lotus\notes\data\mail\*.nsf"
SET objNet = CreateObject("WScript.NetWork")
compName = objNet.ComputerName
SET 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)
            SET objFile = objFSO.OpenTextFile("olderthan2usernsf.txt", ForAppend, True)
            objFile.writeLine(compName & " *.nsf Does Exist " & ldLast)                        
      END IF
      SET objFile = objFSO.OpenTextFile("noexistusernsf.txt", ForAppend, True)
      objFile.writeLine(compName & " *.nsf does not exist ")

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros