Jump to content

Is There A Better Way?


Recommended Posts

Hello all,

I am currently using the following script to list some files that are

known to be in the system32 folder, however i was wondering if there is

a cleaner way of doing the same thing?

@echo off

cls

set dr1=%windir%\system32

set fnd1=dir/s/b %dr1%\ImagX7.dll %dr1%\ImagXpr7.dll %dr1%\ImagXR7.dll

%dr1%\ImagXRA7.dll %dr1%\nerocd95.vxd %dr1%\NeroCheck.exe

%dr1%\oleaut32.dll %dr1%\picn20.dll %dr1%\stdole2.tlb

%dr1%\TwnLib20.dll %dr1%\TwnLib4.dll

for /f "usebackq delims= tokens=1,2*" %%i in (`%fnd1%`) do echo %%i

All responses very appreciated :)

Link to comment
Share on other sites


@echo off
cls
for %%i in (ImagX7.dll ImagXpr7.dll ImagXR7.dll ImagXRA7.dll nerocd95.vxd NeroCheck.exe oleaut32.dll picn20.dll stdole2.tlb TwnLib20.dll TwnLib4.dll) do if exist %%i (del %%i) else (echo %%i not found)

Short enough?

Link to comment
Share on other sites

@echo off
cls
for %%i in (ImagX7.dll ImagXpr7.dll ImagXR7.dll ImagXRA7.dll nerocd95.vxd NeroCheck.exe oleaut32.dll picn20.dll stdole2.tlb TwnLib20.dll TwnLib4.dll) do if exist %%i (del %%i) else (echo %%i not found)

Short enough?

this works perfectly - thanks Iceman :thumbup

for %%i in (ImagX7.dll ImagXpr7.dll ImagXR7.dll ImagXRA7.dll nerocd95.vxd NeroCheck.exe oleaut32.dll picn20.dll stdole2.tlb TwnLib20.dll TwnLib4.dll) do if exist %windir%\system32\%%i (del /q "%windir%\system32\%%i")

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...