|
|
|||||||
I would like to see a new function added to KiXtart that would allow for the COPY/MOVE/DELETE of in use files. Further information can be reviewed here. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/movefileex.asp http://www.jsiinc.com/subk/tip5300/rh5378.htm You can add a single entry into this location with KiXtart to delete a file that is currently locked, but you can't seem to add multiple entries possibly due to the use of NULL The program MoveEX can if run multiple times can add multiple files to the list as marked for DELETION on the next reboot. Files are not deleted by this process live, this happens after a reboot of the system. The Key location is here HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations The new function should support Adding entries for Copy/Move/Delete as well as removal of current entries. |
||||||||
|
|
|||||||
See the UDF Forum under UpdateFileOnReboot()- Schedules a file to be replaced on reboot. I will update this function to include file removal if only one parameter is being supplied to it. |
||||||||
|
|
|||||||
Yes, I've seen the UDF, but I would like KiXtart to be able to deal with MULTIPLE files/folders just as the INUSE program from Microsoft does. I can easily manage any operation on a single file, it's the multiple files/folders that is an issue. |
||||||||
|
|
|||||||
It does support multiple files. It will always append to the existing content of the PendingFileRenameOperations registry value. It currently just doesn't support the removal of in-use files, just the replacement. |
||||||||
|
|
|||||||
Jens, I've been trying to do just this, no success before. As mentioned at the top of this thread, Nulls seem to be the catch. I haven't found a way to write a null string to this key, which is required as the second string to delete a file. I'm hoping, from your post here, that you have a way! [Topic closed by moderator because it is posted to wrong forum] |
||||||||
|
|
|||||||
I still don't see that your UDF is able to handle the removal of multiple files correctly, so I still opt to ask/suggest that a similar function as the INUSE.EXE has be added to KiXtart. |
||||||||
|
|
|||||||
If you're talking about my UDF, it only deals with the replacement of files during reboot. |
||||||||
|
|
|||||||
It's an interesting problem. Null values are illegal in REG_MULTI_SZ records - try adding one manually and REGEDIT will bitch about it and remove the null string. |
||||||||
|
|
|||||||
...but I have a way to do it [update] Damnit! I had a solution but it writes in ASCII, and the registry strings need to be UNICODE |
||||||||
|
|
|||||||
what is this problem you talk about? |
||||||||
|
|
|||||||
Jens, Quote: I've tried a few methods but I'm unable to get your udf to properly handle multiple files for replacement either. As far as I can tell this requires the nul value which I don't think KiXtart can do natively. If I'm wrong that's cool, please post a valid working example. Think Ruud could easily add this to KiXtart though with very minimal effort and size increase. Have seen code around 20k to do this I think, but a lot of that size is just the fact of creating the EXE in the first place I would guess, so the increase for the KiXtart EXE would probably only increase a very small amount. |
||||||||
|
|
|||||||
so, what's wrong with the pipe-character? doesn't it write null to the regvalue? |
||||||||
|
|
|||||||
Quote: No, for two reasons. First, two pipes together "||" are interpreted as a pipe character in the data rather than a null field. Second, have you tried using Regedit to add a null entry to the value? It removes it and states that null values are not allowed in REG_MULTI_SZ strings. You *can* write them. I've done it using StdRegProv and SetMultiStringValue along with my binary data UDFs. The problem is that the values need to be (sort of) UNICODE. I got part way through writing the ASCII -> UNICODE conversion stuff, but "real work" has intervened and as this is not something I need right now I have had to drop it. If anyone would like to pick it up and complete it, here is what I have so far... Code: Break ON The problem is that the ASCIItoUNICODE function converts the string OK, but because it ends up as a BYTE ARRAY the .SetMultiStringValue method rejects the data. I've also tried reading the data back from the converter using .ReadText with a charset of Unicode. While this returns a string is appears to get set back to an ASCII type which kind of defeats the object. |
||||||||
|
|
|||||||
Has anyone heard anything from Ruud about this? I end up wanting/needing this type of support from KiX quite often now. |
||||||||
|
|
|||||||
you talking about inuse() stuff or what? |
||||||||
|
|
|||||||
Yes, I'd like to see KiXtart natively support a file inuse type function that would alter the registry properly and allow files to be removed/replaced on reboot. |
||||||||
|
|
|||||||
Done in 4.52 Beta 2 |
||||||||
|
|
|||||||
Cool, I'll test this and the RD and post back. |
||||||||
|
|
|||||||
Okay took me a while but finally did some testing. Well as it turns out Ruud didn't tell us what that NEW switch was in 4.52 beta 2 for DEL and MOVE From the readme for 4.52 beta 2 Quote: As it turns out the switch to use is /P Using DEL and MOVE with /P worked as expected. It placed valid entries for single or multiple files into the 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager' PendingFileRenameOperations Files were deleted on reboot, or moved to new location. THANK YOU RUUD - Really nice to finally have this working. Greatly appreciated. |
||||||||
|
|
|||||||
hmm... the beta2 post is screwed up now but nonetheless, in the notes ruud did say the switch: http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=154281 |
||||||||
|
|
|||||||
Can somebody test whether MOVE /P will work if the source file resides on a share, UNC, or external drive like USB Stick? My gut feeling is that MOVE /P is designed to work with only local files. This should then be added to the documentation. My UDF that replaces in-use files is specifically coded to copy files to the local drive to take care of situations where the source file is remote. |
||||||||
|
|
|||||||
Don't need to Test. The files will only be removed from local device. The MOVE and DEL /P happen right after the AUTOCHECK routine which does not have access to any remote drives at that point in time. Possibly USB as long as it loads from BIOS and not by Windows drivers. |
||||||||
|
|
|||||||
Okay I think the DEL is not correctly implmented on Windows 9x with the WININIT.INI file. An example entry after using is: [rename] C:\WINDOWS\Temporary Internet Files\Content.IE5\index.dat=NUL This is wrong for 2 reasons. 1. Long file names are not supported at that point in time 2. The DestinationFileName (in this case NUL) comes first not last Working example: [rename] NUL=C:\WINDOWS\TEMPOR~1\CONTENT.IE5\INDEX.DAT Further explanation can be found in this KB How To Move Files That Are Currently in Use http://support.microsoft.com/kb/140570 Quote: |
||||||||
|
|
|||||||
Well actually I take back item 1 on long file names. That was due to my own coding and does not need to be part of KiX executable (unless Ruud wants to add ERROR code to trap when a Long Filename is being used on Windows 9x - otherwise disregard the report of this as an error in the program) The NUL though should be reversed to come first for deletes. I did not test the MOVE functionality on Windows 9x but would assume it has same issue. |