Concerning your latest edit:
Code:
@echo off
:: The (%*) allows for multiple directories and files to be deleted recursivly.
FOR %%F IN (%*) DO ECHO Y| cacls %%F /T /C /G Administrators:F
:Set proper attributes for directories
FOR %%F IN (%*) DO attrib -h -s -r -a %%F /S /D
:Set proper attributes for files
FOR %%F IN (%*) DO attrib -h -s -r -a %1\*.* /S /D
FOR %%F IN (%*) DO sdelete -p 12 -s -q %%F
I still would like to understand how to correct this in a bat file can accomplish this.
Does not the above code work? Could you re-phrase your question?
I worded that wrong, my apologies. The above "sdelete" code does work. It was the previous code
that did not work for which you explained and wrote new code seen below:
Set newname=%RANDOM%.%RANDOM%
ren %1 %newname%
DEL %~d1%~p1%newname%
pause
exit
After reading your explanation and seeing the new code I had complete confidence that it too would work
just fine, but it did not. When I sent the test.txt to the shortcut to the new code this is what I got in return.
c:\docume~1\user>Set newname=725.23907
c:\docume~1\user>ren "C:\docume~!\user\desktop\test.txt 725.23907
c:\docume~1\user>DEL C:\docume~1\user\desktop\725.23907The system cannot find the file specified.The DEL command seems to have found the right path this tim with the addition of the
%~d1%~p1
, but an error was still geteratted stating that it could not be found.
Now this is getting really strange! I do appreciate the time you've taken to explain this to me.