Jump to content
Sign in to follow this  
TheIceman

Search Physical Drive for files

Recommended Posts

TheIceman

Hey,

As a newbie in scripting without any programming xperience i need some help here from some scrip-wizards.

I would like to run a script which allows me to search a physical drive recursivly(all partitions) for a pre-created group of file-extensions(need 3 different groups). Then i want to copy those found files to a directory i can choose manually. And if the file allready exists in that directory, i want the script to rename the duplicate file numbering the name up.

Ex.

Search harddisk A (has partions 1,2) for pre-created group alfa (containing extensions .bat, .cmd, .ini)

Found on harddisk A partition 1 files autoexec.bat, test.cmd, desktop.ini and on partition 2 the file test.cmd

The result in my target chosen folder should be autoexec.bat, test.cmd, test01.cmd and desktop.ini

Hope this was explained well.

Searched the forums allready but couldn't find anything about searching a physical drive, so i'm stuck at the beginning.

Noob in need ;-)

Iceman

Edited by TheIceman

Share this post


Link to post
Share on other sites
Melba23

TheIceman,

When you post here it always helps if you have had a go at solving your problems beforehand. Having some code to work on is a great help - and no-one here is too keen to help the "code it for me" brigade. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers. :idea:

Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading.

Here are some pointers to get you looking in the right direction: :)

- You can get an array of the available drives by using DriveGetDrive.

- If you search "+recursive +file +search" you will find lots of scripts for searching an entire drive - many of them enable you to specify the file extensions you want to include.

- Once you have found the files with the extensions you require, you can check if one of your groups exists among them using _ArraySearch.

- You can choose a folder with FileSelectFolder.

- You can copy the files with FileCopy - renaming any preexisting ones can be done with FileMove.

That should give you a start. :)

Have a go at coding something yourself. You know where we are when you run into problems. :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
TheIceman

Melba,

I don't expect you guys to do it for me.

The way that you're pointing me in is better so i can learn and understand the scripting way.

Will post my findings and when i'm stuck again.

Thnx for the fish

Iceman

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.