Jump to content

Shell Scripting


kingsc

Recommended Posts

So I've made a batch file to search the entire computer utilizing xcopy and copy these certain types of files to an external HDD.

Is there any way to force xcopy to just dump the files I want -without- building the directory structure?

I just want pictures in a pictures folder, docs in a doc folder, etc.

I don't want to have to sort through WINDOWS\System32\bla.jpg and Local Settings\App Data\Microsoft\<Whatever>\bla2.jpg to figure out what's junk and what's not. Here's the contents of my batch file so far.

@echo off

::BANNER
echo ==============================================================
echo ============== ==================
echo ============== ExtractIT v1.0 by ==================
echo ============== ==================
echo ==============================================================
echo.
echo.

::CONFIGURATION
set extractpoint="f:\EXTRACT"


::PICTURE EXTRACTION
echo Performing picture extraction...
echo.
echo.
xcopy /I /S /G /H /Q /Y /C c:\*.jpg %extractpoint%
echo.
echo.
echo JPG files extracted.
xcopy /I /S /G /H /Q /Y /C c:\*.jpeg %extractpoint%
echo.
echo.
echo JPEG files extracted.
xcopy /I /S /G /H /Q /Y /C c:\*.bmp %extractpoint%
echo.
echo.
echo BMP files extracted.
echo.
echo.
echo Picture extraction complete.
echo.
echo.
echo Performing document extraction...
xcopy /I /S /G /H /Q /Y /C c:\*.doc* %extractpoint%
echo.
echo.
echo Word document extraction complete.
xcopy /I /S /G /H /Q /Y /C c:\*.xls* %extractpoint%
echo.
echo.
echo Excel spreadsheet extraction complete.
xcopy /I /S /G /H /Q /Y /C c:\*.pdf %extractpoint%
echo.
echo.
echo Adobe PDF document extraction complete.
echo.
echo.
echo Document extraction complete.
echo.
echo.
echo Extraction complete, have a nice day! =)
echo.
echo.

::RESTORE ORIGINAL CONFIGURATION
set extractpoint=

pause

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...