Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
batch file to search all drives
Name: houdinihar Date: January 6, 2009 at 10:14:36 Pacific OS: Windows XP, sp2 CPU/Ram: 2.8 ghz intel, 500mb Product: Unknown / DELL Subcategory: Batch
Comment:
I want to create a batch file that needs to scan all my drives for "autorun.inf" remove all attributes then del these files because of a virus. here is what I have so far and it isn't refined. // @echo off CLS rem "code needed for fixed drive search. probably some kind of a nested loop to include below code when each fixed drive is found." IF EXIST autorun.inf attrib -s -h -r autorun.inf /d DEL autorun.inf "repeat until all drives searched" exit ///////////////
any help to complete would be greatly appreciated. houdinihar
Name: reno Date: January 6, 2009 at 22:24:09 Pacific
Reply:
search all available drives include floppy & cdrom. sorry, no checking against those drive.
@echo off & setlocal enabledelayedexpansion
for /f "tokens=1,2 delims=\ " %%a in ('fsutil fsinfo drives^|more/e/t0') do ( if "%%b"=="" (set drive=%%a) else set drive=%%b echo scanning !drive! for /f "tokens=*" %%f in ('dir !drive!\autorun.inf /b /s 2^>nul') do attrib -a -s -h "%%f" & del "%%f" & echo %%f )
Summary: I found a batch script to search all drives and delete the autorun.inf file on this forum I want that method but change it up a bit. I would like to Search all drives for a specific file and copy the ...
Summary: Hi, great site! Iv been helped a lot by this forum over the last week while putting together a batch file..this is 1 of the best batch sites iv found..of which there are many...so thanks so far -----...
Summary: Hi, I need a Batch File to search files with the extension ".glb" in a specified directory, and if any one of the files has the extension as ".glb", i need to store the entire file name to a variable ...