Avatar of Claudio Herrera
Claudio Herrera
Flag for Mexico asked on

PendingFileRenameOperations Batch file help need it in order to work

Dear Experts

I found this batch file and I wanted to work under Win XP SP3,

I need a batch file to delete protect files by windows or when the file it is being used by another person or progam the only way to do this is after restart

For testing purposes I will use the following path
C:\Documents and Settings\Rebelscum\Desktop\test.txt

Not using

del "%userprofile%\desktop\test.txt" OR

del "%userprofile%\..\Rebelscum\desktop\test.txt

You may understand me what i want if you read the following thread

http://www.pcreview.co.uk/forums/pendingfilerenameoperations-delete-file-t1715654.html

Thank you very much for any help you can provide me

Rebel

:: Critical conditions for this script to run as intended:
:: - to be run by someone with administrator privileges.
:: Non-critical conditions for this script to run as intended:
:: - to be run on win7 or above ( timeout )
::
@echo off
set RenEngKeyPath=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
set $rnd=%random%%random%

:: reg add "%RenEngKeyPath%" /f /v "AllowProtectedRenames" /t REG_SZ /d 1 >nul
:: reg add "%RenEngKeyPath%" /f /v "PendingFileRenameOperations" /t REG_MULTI_SZ /d

"
\??\%systemroot%\system32\credui.dll
!\??\%systemroot%\system32\%$rnd%.dll

\??\%systemroot%\explorer.exe
!\??\%systemroot%\%$rnd%.dll
"
>nul

echo
timeout 1 >nul
:: shutdown /s /t 0
Windows BatchProgrammingWindows OSWindows XP

Avatar of undefined
Last Comment
Claudio Herrera

8/22/2022 - Mon
Zoppo

Hi rebelscum0000,

if there's no reason against I would suggest to use any existing tool which can do this, i.e. one from SysInternals: http://technet.microsoft.com/en-us/sysinternals/bb897556

Hope that helps,

ZOPPO
David Johnson, CD

Why do you want to play with
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
credui.dll and explorer.exe

i.e. rename or delete them? Can you give me a reason why one should delete these system files..  From your earlier question which is pending deletion
https://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_28075890.html which this is an duplicate only missing the echo line
echo inb4 OP is hip
timeout 1 >nul
:: shutdown /s /t 0

You have raised my suspicions as to whether or not you should be helped.

(Edit: "Echo" sanitized by Modulus_Twelve.)
Claudio Herrera

ASKER
Hi

I found this batch with this examples (In a few words I copied and pasted)
The goal is to delete index.dat files after restart my computer, not to delete these system files,

@ZOPPO

With PendMoves I cannot reach the path

C:\Documents and Settings\Rebelscum\Local Settings\Temporary Internet Files\Content.IE5\index.dat

Thanks in advance for understanding the situation
 
Regards

Rebel
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Sudeep Sharma

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Claudio Herrera

ASKER
Ok let me try!!