Jump to content

Delayed File Delete or Move


Recommended Posts

I have been trying to use Autoit to perform a delayed file delete or move using the registry key:

HKLM\System\Currentcontrolset\Control\Session Manager","PendingFileRenameOperations"

The OS on which I'm attempting to perform the operation is Windows XP SP3. I have seen some references to this and have duplicated the syntax exatcly but for some reason it doesn't appear to work. Below is a sample of the code I'm using:

RegWrite("HKLM\System\Currentcontrolset\Control\Session Manager","PendingFileRenameOperations","REG_EXPAND_SZ","\??\d:\xxx.txt" &@CRLF & "!\??\d:\yyy.txt" &@CRLF)

I found a function in the Winbatch language intcontrol(30) that performs this exact function which works everytime. I used the winbatch function to create the key value. Exported the key value and examined the results with a bianary viewer. Then I created the regkey value using Autoit. Exported the key value and examined the results with a binary viewer. They were identical. Yet the Key Value created using the Winbatch function worked and the Key Value created using the AutoIt code above does not. This seems very straight forward so I'm wondering if there is more going on than just this key value. Any help is appreciated.

Link to comment
Share on other sites

RegWrite("HKLM\System\Currentcontrolset\Control\Session Manager","PendingFileRenameOperations","REG_EXPAND_SZ","\??\d:\xxx.txt" &@CRLF & "!\??\d:\yyy.txt" &@CRLF)

Welcome to the forums.

You need to change @CRLF to @LF. (See the Help file entry for RegWrite)

What is the purpose of the exclamation mark in the destination string?

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...