Jump to content

Delete Files Safely


Recommended Posts

Most people take this one for granted these days. They pass it around like it's Internet common knowledge. But it took me a very long time to figure out how to do this. I emailed script writers to help me. I bugged them half to death on forums. No one knew exactly how to do this. So, yes, this is my script...no matter who else you think created it.

I have incorporated a failsafe feature into my batch files.

Files and folders will be moved and saved (Not deleted permanently. Later that will be up to you.) to a backup folder on C:\. The backup folder is simply named "Backup".

Within the Backup folder, you will find the files and folders you removed, in smart placement. Their order of appearance will be identical to how XP's files and folders appear on your C Drive.

When you remove files and folders from the WINDOWS and system32 directories, in the Backup folder you will first see a WINDOWS folder. Within the WINDOWS folder you will see the individual files and subfolders you removed, including the system32 folder. And within the system32 folder you will see its individual files and subfolders you removed. The same applies to the Documents and Settings and the Program Files directories.

I created this smart placement so you would always know exactly where these files and folders came from should you decide to replace any to their original locations.

Here's an example to get you started on making one for yourself.

IF NOT EXIST "%systemdrive%\backup\WINDOWS\system32" md %systemdrive%\backup\WINDOWS\system32
MOVE %systemdrive%\WINDOWS\system32\jgaw400.dll %systemdrive%\backup\WINDOWS\system32\
MOVE %systemdrive%\WINDOWS\system32\jgdw400.dll %systemdrive%\backup\WINDOWS\system32\
MOVE %systemdrive%\WINDOWS\system32\jgmd400.dll %systemdrive%\backup\WINDOWS\system32\
MOVE %systemdrive%\WINDOWS\system32\jgpl400.dll %systemdrive%\backup\WINDOWS\system32\
MOVE %systemdrive%\WINDOWS\system32\jgsd400.dll %systemdrive%\backup\WINDOWS\system32\
MOVE %systemdrive%\WINDOWS\system32\jgsh400.dll %systemdrive%\backup\WINDOWS\system32\

Link to comment
Share on other sites

  • 1 year later...

i don't know much about batch programming but this is what i know.

u wrote

MOVE %systemdrive%\WINDOWS\system32\jgaw400.dll %systemdrive%\backup\WINDOWS\system32\

insted u can also use %windir%\system32\gaw400.dll %windir%\system32\backup

"%systemdrive%\WINDOWS\" may not aply to all XP os cuz while installing windows i may rename my xp folder to "winXP" or like that...so in this case ur script may fail.

also start a batch code with echo is good. and clean

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...