-
Useful DOS Batch files I've written:
-
Look for a string in a set of files
@echo off
IF "%1"=="/?" GOTO Help
IF "%1"=="" GOTO Help
IF "%2"=="" GOTO All
FOR /R ./ %%f IN (%2) DO (
find /I /N "%~1" "%%f" >nul
IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 find /I /N "%~1" "%%f"
)
GOTO End
:All
FOR /R ./ %%f IN (*.*) DO (
find /I /N "%~1" "%%f" >nul
IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 find /I /N "%~1" "%%f"
)
GOTO End
:Help
echo Looks for text in files
echo LOOK "string" [filename]
echo.
:End
-
Set the Date Format
@echo off
regedit /e __backup.reg "HKEY_CURRENT_USER\Control Panel\International"
echo Windows Registry Editor Version 5.00 > __temp.reg
echo [HKEY_CURRENT_USER\Control Panel\International] >> __temp.reg
echo "sShortDate"="yyyy.MM.dd" >> __temp.reg
regedit /S __temp.reg
date /t
regedit /S __backup.reg
del /F /Q __backup.reg
del /F /Q __temp.reg
|