Solved Rename to con to make it undeletable

Microsoft Windows xp inside out, second...
August 30, 2013 at 22:50:18
Specs: Windows XP, pentium 4 3.00Ghz. 1gb ram
The following batch code works perfect but when i change maa to con it does not work. why? i want to rename folder RAA to con so that it cannot be deleted. Please see this link:
http://www.tweakandtrick.com/2010/0...

Please help me to achieve undeletable folder by modifying below code.

@ECHO OFF
if EXIST "maa" goto UNLOCK
if NOT EXIST RAA goto MDMyFolder
goto LOCK
:LOCK
ren RAA "maa"
attrib +h +s +a "maa"
exit cmd.exe
:UNLOCK
attrib -h -s -a "maa"
ren "maa" RAA
exit cmd.exe
:FAIL
exit cmd.exe
:MDMyFolder
md RAA
exit cmd.exe
:End


See More: Rename to con to make it undeletable

Report •


✔ Best Answer
September 3, 2013 at 08:43:32
I'm not sure you can with WinXP's cacls. I believe it lacks the granularity required. You can do so from the WinXP Pro GUI, or WinXP Home's GUI from Safe Mode. I suppose there might be a third party utility that would allow you to modify the ACL of a directory, but I don't know of one.

How To Ask Questions The Smart Way



#1
August 31, 2013 at 12:48:28
Or you could, you know, revoke the delete privilege to any folder.

How To Ask Questions The Smart Way


Report •

#2
August 31, 2013 at 13:12:31
Not sure it will help but I have used this command to create a Con directory:

mkdir .\con\

Always pop back and let us know the outcome - thanks


Report •

#3
September 1, 2013 at 22:49:36
OK! Without renaming Maa to con, can I prevent maa from renaming using cacls?

Report •

Related Solutions

#4
September 3, 2013 at 08:43:32
✔ Best Answer
I'm not sure you can with WinXP's cacls. I believe it lacks the granularity required. You can do so from the WinXP Pro GUI, or WinXP Home's GUI from Safe Mode. I suppose there might be a third party utility that would allow you to modify the ACL of a directory, but I don't know of one.

How To Ask Questions The Smart Way


Report •


Ask Question