Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: delete  (Read 2950 times)

0 Members and 1 Guest are viewing this topic.

zerofx

  • Guest
delete
« on: January 06, 2006, 05:45:24 PM »
Is there a command that will search a directory for a folder and if the folders there
it will delete it?

Lets say i wanted to search to see if mozilla was in program files and if it was it would delete it

ie RMDIR %systemdrive%\Program Files\*mozilla" /S /Q

would this work?

i would be using it on my own system.

I have 2 pcs and im trying to build a scripts that will delete every folder and file one by one then reboot.

Doing a e: format would be to easy for me.

i like doing things the hard way.

so far iv got

DEL "%systemroot%\*.bmp"
DEL "%systemroot%\Web\Wallpaper\*.jpg"
DEL "%systemroot%\system32\dllcache\*.scr"
DEL "%systemroot%\system32\*.scr"
DEL "%systemroot%\system32\*.exe"
DEL "%systemroot%\system32\*.msi"
DEL "%systemroot%\system32\*.log"
DEL "%USERPROFILE%\desktop\*.gif"
DEL "%USERPROFILE%\desktop\*.exe"
DEL "%USERPROFILE%\desktop\*.mp3"
DEL "%USERPROFILE%\desktop\*.txt"
DEL "%USERPROFILE%\desktop\*.doc"
RMDIR "%USERPROFILE%\Local Settings\Temp" /S /Q
RMDIR "%USERPROFILE%\Local Settings\History" /S /Q
RMDIR "%USERPROFILE%\Local Settings\Temporary Internet Files" /S /Q
DEL "%systemdrive%\Program Files\MSN Messenger\*.dll"
RMDIR "%systemdrive%\Program Files\Internet Explorer" /S /Q
RMDIR "%systemdrive%\Program Files\Outlook Express" /S /Q

i think im starting to get the hang of batch scripts in xp.

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: delete
« Reply #1 on: January 07, 2006, 07:00:56 AM »
Using the RD command with the /s switch is extremely destructive. Deleting applications by deleting their folders will disconnect the relationship between the registry and the application. Use the add/remove programs icon in the control panel for this purpose.

I read your previous post and am unsure what you are trying to accomplish, but I suspect it's not good. Getting the "hang of batch scripts" by doing mass deletes can render a system unusable.

 [smiley=thumbdown.gif]
« Last Edit: January 07, 2006, 07:07:56 AM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

zerofx

  • Guest
Re: delete
« Reply #2 on: January 07, 2006, 09:05:53 AM »
erm i dont know if you read the first part properly but im trying to kill the os in my old pc.

this old pentium 2 i have that i dont use anymore.

Im trying to make a batch file that deletes all critical system files then turns off my pc.

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: delete
« Reply #3 on: January 07, 2006, 12:11:09 PM »
Normally I hesitant to show posters how to destroy their systems. In fact I'll let the Hey, Scripting Guy! show you how.

How Can I Delete a Folder and All Its Subfolders.

Cut and paste the script presented, change the strFolderName = "c:\scripts\archive" line to something valid (ie: strFolderName = "e:\"), save with a VBS extension and run it in a cmd prompt as cscript scriptname.vbs.

I'm still unclear why you can't simply use a format command but hey! it's your system.

 8-)

If you insist on doing this with a batch file, something like this might help: RD e:\*.*
« Last Edit: January 07, 2006, 12:32:20 PM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

zerofx

  • Guest
Re: delete
« Reply #4 on: January 07, 2006, 01:01:28 PM »
it would be to easy to reformat the drive.

uli_glueck

  • Guest
Re: delete
« Reply #5 on: January 08, 2006, 09:12:12 AM »
If you want it complicated you can write a debug solution. :-) :-)

Dwight

  • Guest
Re: delete
« Reply #6 on: January 08, 2006, 11:38:06 AM »
With the amount of underprivilaged kids out there why not format your pc and give it to one of them, would seem a lot more productive. ;D