Shortcut to Clear Recently Opened Documents

You had two lines in your batch file. And the the way windows executes a batch file is that if one of the statement fails, the batch processing does not terminates, it will continue executing all statements irrespective of whether any previous statements passed or failed.
So, if C:\Documents and Settings\Administrator\Recent\ directory didnt exist on your system, it failed and stayed in root directory that is c:\
The next statement "del ." deleted everything (that it could) from your root - which is something you never wanted.

If you had read one of my previous posts on this thread i said to ** REPLACE ** "cd " with "del " so that even if it failed, nothing harmful would be done.

Illegal solutions will work, but some virus scanners might object the use of "Filesystes.Scripting" object.

Your safest bet would be to do the following -
1. identify your "recent" folders - they are just ordinary folders on your drive just like other regular ones. except that windows keeps some different icon for them when you view them in your windows explorer.
2. Because different versions of windows maintain different folder structures under "C:\Documents and Settings" so i cant tell you what your folder path would look like.
On my system it looks like C:\Documents and Settings\\Recent
where might be "Administrator" or the user name you use to login into windows.
It might well be something like -
C:\Documents and Settings\devendra.khoker\\Local Settings\Recent
or
C:\Documents and Settings\\Local Settings\My Recent Documents

Find yours.

2. Then create a text file on your C:\ (I have a reason to put it in root dir) and put the following lines in it -
DEL
"C:\Documents and Settings\\" /p

Repeat this lines for all the user names you want to make this happen for.
Please note that -
a. The entire path is enclosed in double quotes to make it appear as a single argument to del command.
b. there is a second argument /p - It will ensure a "silent" operation. The command wont wait for your response to "All files will be deleted. Are you sure?" type of prompts

3. Exit notepad after saving.
4. Rename the file to something like "clear.bat" - whatever before the dot is unimportant, but it should have an extenstion of "bat" to be able to function properly. Windows in default settings DOES NOT display file extensions. So you cant change the extenstions if you havent changed these default settings.
There are two ways to do it -
1. START -> RUN -> Type "CMD" ->
2. CD \
3. REN [your-original-file-name] clear.bat

OR

1. Windows Explorer -> Tools Menu -> Folder Options -> View Tab ->
Clear the tick mark in "Hide extensions for known file types"
2. select [your-original-text-file] and right click -> rename.


Finally, place a shortcut to this file on your desktop.

0 comments:

Post a Comment

FEEDJIT Live Traffic Feed

Labels

Find Me On

Follow Us on Twitter Become a fan on Facebook JOin us on Orkut
free counters

Blog Archive

This site does not store any files on its server.We only index and link to content provided by other sites or search engines.