I am trying to programmatically set the "Last Modified" date on a bunch of folders. I've seen three methods to do this: two use .NET calls to mscorlib.system.io.directory or .directoryinfo, and one uses the OpenG File Info function.
None of these methods work for me (Windows 7 (x64) with LabVIEW 2012, 32-bit).
The .NET routines generate Error 1172, "Error calling static method System.IO.Directory.SetLastAccessTime, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.IO.IOException: The process cannot access the file 'D:\BS\Documents\LabVIEW\Labs\B-Lab\Set Folder Dates\Test Folder' because it is being used by another process.) <append><b>System.IO.IOException</b> in Folder Write Time.vi"
The OpenG File Info function doesn't give me an error, but neither do it modify the Modification Date (or the Creation Date) of a folder (though it works fine for files).
Anyone have any idea what is going on, and/or how to fix this? I've attached the code I used to test this out.
Bob Schor
Test File Info.vi