There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Software Development
Tag Cloud
audio bios blue screen boot bsod computer connection crash dcom dell driver drivers email error excel firefox google hard drive hardware hijackthis internet laptop logon logs off macro malware microsoft motherboard network networking problem ram recovery router screen slow software sound trojan usb userinit.exe virus vista webcam wifi windows windows 7 windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Batch Questions

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
MikeSwim07's Avatar
Computer Specs
Distinguished Member with 4,697 posts.
 
Join Date: Apr 2007
Location: Cleveland, Ohio
15-Jun-2008, 01:12 PM #1
Batch Questions
How do I get a batch script to display the files and folders and registry keys created in the last 30 days. Also how do I get a batch file to show the files/folders modified in the last 3 months. Thanks, Mike
devil_himself's Avatar
Distinguished Member with 4,922 posts.
 
Join Date: Apr 2007
Location: India
Experience: Advanced
15-Jun-2008, 11:16 PM #2
How do I get a batch script to display the files created in the last 30 days ?
How do I get a batch file to show the files modified in the last 3 months ?

On The Whole 'Hard Drive' (Fixed Or Network Drives Or Both) Or On The 'Root Drive' ?
Do You Want The Script To Look For All The Drives Or You Want It Hard Coded In The Script ?

How do I get a batch script to display registry keys created in the last 30 days?

Cannot Be Accomplished Using Batch Script . You Need To Use A Third Party App !

Ask A Mod To Move This Thread To 'DOS' Forum Where You Will Get More Better Replies
Squashman's Avatar
Trusted Advisor with 15,375 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
16-Jun-2008, 12:26 AM #3
You can use forfiles to do that in a batch file.

But Windows Search can do that basic functionality as well.
devil_himself's Avatar
Distinguished Member with 4,922 posts.
 
Join Date: Apr 2007
Location: India
Experience: Advanced
16-Jun-2008, 02:25 AM #4
Used "GetDate" Function From -- > http://www.commandline.co.uk/lib/treeview/index.php

and some of my old scripts

batch script to display the files created in the last 30 days ?

Will Search All Fixed Hard Drives !

Code:
@echo off
setlocal
 
Set daycount=30
 
call :^GDP
call :^SD
 
set D=%yy%%mm%%dd%

for /f "tokens=1 delims=\" %%d in ('fsutil fsinfo drives ^| find "\"') do (
      fsutil fsinfo drivetype %%d | findstr /i "Fixed" >nul
      if not errorlevel 1 (
            call :^S %%d
            
      )
)


goto :EOF

:^S

pushd %*\

for /f "tokens=*" %%a in ('dir /b /a-d /s 2^>NUL') do call :^P "%%~dpnxa" %%~ta

goto :EOF

:^P

call :^GDP %~2

if /i "%yy%%mm%%dd%" GEQ "%D%" echo "%~1"

goto :EOF

:^GDP
 
if "%date%A" LSS "A" (set toks=1-3) else (set toks=2-4)
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo:^|date') do (
  for /f "tokens=%toks% delims=.-/ " %%d in ('date/t') do (
    set %%a=%%d
    set %%b=%%e
    set %%c=%%f
    set toks=
  )
)

if %yy% LSS 100 set yy=20%yy%

goto :EOF

:^SD

:: strip leading zeros from possible octals
set /a mm=1%mm%-100, dd=1%dd%-100

if /i %daycount%==0 goto ^DS
set /a daycount-=1

:^CD
set /A dd-=1
if %dd% GTR 0 goto DONE

:: today is the 1st of the month,decrement the month
set /a dd=31, mm-=1

if %mm% GTR 0 goto ^AD

:: If today is 1 Jan, set date to 31st Dec
set /a mm=12, yy-=1
goto DONE

:^AD

for %%a in (4 6 9 11) do if %mm% == %%a goto ^CD 

if not %mm%==2 goto DONE

set /a ly=yy%%4
if %ly% EQU 0 (set dd=29) else (set dd=28)

:DONE

if /i %daycount%==0 goto ^DS
if %dd% GTR %daycount% goto ^TM
set /a daycount=%daycount% - %dd%
set dd=1
goto ^CD

:^TM

set /a dd=%dd% - %daycount%

:^DS

:: now convert back to 2-digit dd,mm
if %mm% LSS 10 set mm=0%mm%
if %dd% LSS 10 set dd=0%dd%

goto :EOF
Closed Thread Bookmark and Share   techguy.org/721621

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 04:13 PM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.