Jump to content

Deleted files come back using .cmd


 Share

Recommended Posts

I am using a .cmd file to delete some files, mainly bitmaps and screen savers. This is in my cleanup.cmd and created using the example file in the unattended guide. The bitmaps that are deleted stay deleted but the screen savers keep coming back after the script is run. Are they protected by windows file protection? Do I need to turn it off, delete the files and turn it back on? How can I do this?

Here is the script:

cmdow @ /HID
net user aspnet /delete

DEL "%systemroot%\*.bmp"
DEL "%systemroot%\system32\dllcache\ss3dfo.scr"
DEL "%systemroot%\system32\dllcache\ssbezier.scr"
DEL "%systemroot%\system32\dllcache\ssflwbox.scr"
DEL "%systemroot%\system32\dllcache\ssmarque.scr"
DEL "%systemroot%\system32\dllcache\ssmypics.scr"
DEL "%systemroot%\system32\dllcache\ssmyst.scr"
DEL "%systemroot%\system32\dllcache\sspipes.scr"
DEL "%systemroot%\system32\dllcache\ssstars.scr"
DEL "%systemroot%\system32\dllcache\sstext3d.scr"
DEL "%systemroot%\system32\scrnsave.scr"
DEL "%systemroot%\system32\ss3dfo.scr"
DEL "%systemroot%\system32\ssbezier.scr"
DEL "%systemroot%\system32\ssflwbox.scr"
DEL "%systemroot%\system32\ssmarque.scr"
DEL "%systemroot%\system32\ssmypics.scr"
DEL "%systemroot%\system32\ssmyst.scr"
DEL "%systemroot%\system32\sspipes.scr"
DEL "%systemroot%\system32\ssstars.scr"
DEL "%systemroot%\system32\sstext3d.scr"

DEL "%AllUsersProfile%\Start Menu\Windows Update.lnk"
DEL "%AllUsersProfile%\Start Menu\Set Program Access and Defaults.lnk"
DEL "%AllUsersProfile%\Start Menu\Windows Catalog.lnk"

RD /S /Q %systemdrive%\Drivers\
RD /S /Q %systemdrive%\Install\

EXIT

I don't want to delete all the screen savers (*.scr) just the ones listed.

Link to comment
Share on other sites


you could try using

Del /F /S

f = force

s = recurse subdirectories. That would halve your entries.

But, seems like WFP is possibly replacing them? If so, you may need a patched SFC_OS.DLL?

Link to comment
Share on other sites

i prefer to use thos command line in \$OEM$\$1\install\run.cmd

also remember to have /q switch

eg

ECHO.

ECHO Removing annoying Wallpapers and Screensavers...

DEL "%systemroot%\*.bmp" /q

DEL "%systemroot%\Web\Wallpaper\*.jpg" /q

DEL "%systemroot%\system32\*.scr" /q

Link to comment
Share on other sites

You should be able to

  • del /f /a /q

Something like this

@echo off&setlocal enableextensions
cmdow @ /hid
set togo=scrnsave ss3dfo ssbezier ssflwbox ssmarque ssmypics ssmyst sspipes ssstars sstext3d
net user aspnet /delete
del /f/a/q "%systemroot%\*.bmp"
for %%a in (%togo%) do call :noscr "%%a.scr"
del /q "%allusersprofile%\start menu\windows update.lnk"
del /q "%allusersprofile%\start menu\set program access and defaults.lnk"
del /q "%allusersprofile%\start menu\windows catalog.lnk"
rd /s/q %systemdrive%\drivers
rd /s/q %systemdrive%\install
endlocal&goto :eof
:noscr
pushd %systemroot%\system32
for /f %%b in ('dir /b/s/a-d %1^2^>nul') do del /f/a/q "%%b"
popd&goto :eof

Link to comment
Share on other sites

Try deleting the equivalent files back to back. In other words, delete "%systemroot%\system32\dllcache\ss3dfo.scr" and immediately after, delete "%systemroot%\system32\ss3dfo.scr". That should get rid of both copies before WFP is able to replace them (and yes, if a file is in dllcache, it's protected by WFP). Of course, you'll be prompted to insert your XP CD when WFP is unable to restore the file from the hard drive.

Link to comment
Share on other sites

You should be able to
  • del /f /a /q

Something like this

@echo off&setlocal enableextensions
cmdow @ /hid
set togo=scrnsave ss3dfo ssbezier ssflwbox ssmarque ssmypics ssmyst sspipes ssstars sstext3d
net user aspnet /delete
del /f/a/q "%systemroot%\*.bmp"
for %%a in (%togo%) do call :noscr "%%a.scr"
del /q "%allusersprofile%\start menu\windows update.lnk"
del /q "%allusersprofile%\start menu\set program access and defaults.lnk"
del /q "%allusersprofile%\start menu\windows catalog.lnk"
rd /s/q %systemdrive%\drivers
rd /s/q %systemdrive%\install
endlocal&goto :eof
:noscr
pushd %systemroot%\system32
for /f %%b in ('dir /b/s/a-d %1^2^>nul') do del /f/a/q "%%b"
popd&goto :eof

It didn't work, screen savers still there. I will still try RyanVM's suggestion but I really don't want a popup for inserting the cd just because I'm anal retentive and want to delete unused screen savers. Thanks for the replies guys.

Link to comment
Share on other sites

If your xp cd is in the drive after it reboots it replaces them on boot, ive found this. You can delete all the screensavers but then if you reboot with the xp cd in the drive it seems to install them all again, dont hold me to this but if I remove the cd they dont come back.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...