I need to be able to move a directory that is being used by another process, and, hence, locked.
I can write a Perl wrapper around TASKLIST.EXE and OH.EXE to find the process that has an open handle on the directory, and then kill the process. However, I am wondering if it is possible to find the open handles of each process using only Perl. Thanks.
C:\scratch2>oh -p 152
00000098 cmd.exe KeyedEvent 0004 \KernelObjects\CritSecOutO
+fMemoryEvent
00000098 cmd.exe Directory 0008 \KnownDlls
00000098 cmd.exe File 000c \scratch2\freddy.old
00000098 cmd.exe Directory 0014 \Windows
00000098 cmd.exe WindowStation 0024 \Windows\WindowStations\Wi
+nSta0
00000098 cmd.exe Directory 0028 \BaseNamedObjects
00000098 cmd.exe WindowStation 002c \Windows\WindowStations\Wi
+nSta0
00000098 cmd.exe Desktop 0030 \Default
00000098 cmd.exe Key 0034 \REGISTRY\MACHINE
00000098 cmd.exe Key 0044 \REGISTRY\MACHINE\SOFTWARE
+\Microsoft\Windows NT\CurrentVersion\Drivers32
00000098 cmd.exe Key 0054 \REGISTRY\MACHINE\SOFTWARE
+\Microsoft\Windows NT\CurrentVersion\Drivers32
00000098 cmd.exe Semaphore 0058 \BaseNamedObjects\shell.{A
+48F1A32-A340-11D1-BC6B-00A0C90312E1}
00000098 cmd.exe Key 005c \REGISTRY\USER\S-1-5-21-32
+9068152-838170752-1801674531-8171
00000098 cmd.exe File 0060 \WINDOWS\WinSxS\x86_Micros
+oft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1
+ff9
00000098 cmd.exe Event 0064 \BaseNamedObjects\userenv:
+ User Profile setup event
00000098 cmd.exe Key 0068 \REGISTRY\MACHINE\SYSTEM\C
+ontrolSet001\Control\Nls\Locale
00000098 cmd.exe Key 006c \REGISTRY\MACHINE\SYSTEM\C
+ontrolSet001\Control\Nls\Locale\Alternate Sorts
00000098 cmd.exe Key 0070 \REGISTRY\MACHINE\SYSTEM\C
+ontrolSet001\Control\Nls\Language Groups