Implementing a "Smart" folder in Windows XP?

N

Noozer

I'm looking for a "smart folder" program to run on my Windows XP machine.
I'm not having any luck finding it and think the logic behind the program is
pretty simple, but I'm not sure how I'd implement this. I've done some VB6
programming and dabbled in VS.Net.

Can someone share some pointers in how I could implement the following?

Basically, you drag a file to the "smart" folder and, depending on the type
of file and settings for that folder, Windows automatically puts it to a
specific place on your computer. Each smart folder would also contain a
folder named "Unknown" for file types that it didn't know how to handle.

If you open the folder, the view contains a folder representing each
location that files could be moved to.

For example...

I have my smart folder on my desktop. My smart folder is set up to put .MP3
files at "C:\Music", .BAK files at "D:\Backups" and .GIF, .JPG and .PNG at
"C:\Pictures".

I have a file, "MyPic.JPG", on my desktop... I drag the .JPG and drop it on
the smart folder. POOF! It's now at "C:\Pictures\MyPic.JPG".

I double click my smart folder and Explorer opens up showing me the
following folders "Music", "Backups", "Our pictures" and "Unknown".

Now, I drag "README.TXT" from my desktop and drop it on the smart folder.
POOF! It's now at "...MyDesktop\SmartFolder\Unknown\README.TXT"

Now, I open the settings for my smart folder and tell it that I want all
".TXT" files to be stored at "C:\Text Files". I hit Apply and OK. Not much
has happened, but NOW I right click on the Unknown folder and choose "Try
again"... POOF! My previously unknow file is now at "C:\Text
Files\README.TXT"

...and the folder would be just as smart as Windows, warning when files
already exist and asking what you want to do (assuming you have the prompt
enabled).

So... any software out there that will do this? If not, any pointers on how
I might be able to write a utility using VB6 or VB.Net?
 
G

Guest

So... any software out there that will do this? If not, any pointers
on how I might be able to write a utility using VB6 or VB.Net?

I you want to write it yourself - you can use the FileSystem Monitor class
to inform your application of a change to the disk (in your case, dropping
a file in the directory).

While your smart folder idea seems "neat"... It doesn't seem practice. How
are you going to implement all the different business rules? i.e. Pictures
goes to the Picture folder, Readme.txt is unknown but HelloWorld.txt goes
to another folder? etc. etc.
 
N

Noozer

Spam Catcher said:
I you want to write it yourself - you can use the FileSystem Monitor class
to inform your application of a change to the disk (in your case, dropping
a file in the directory).

While your smart folder idea seems "neat"... It doesn't seem practice. How
are you going to implement all the different business rules? i.e. Pictures
goes to the Picture folder, Readme.txt is unknown but HelloWorld.txt goes
to another folder? etc. etc.

Three ways so far... Filename matching (regex and Windows wildcards), file
extension and "File begins with 'xx xx xx xx xx' bytes. I'd also consider
more rules for processing ZIP files or directories dropped into a Smart
Folder, but haven't worked on the logic for them just yet.

Rules will be on a first match basis, or optionally, if the file matches
multiple rules it will create multiple copies (or only go to the first
matching rule and create shortcuts to any other matching rules). Rules might
even allow multiple destinations to allow for backup copies to be generated,
etc.

Each rule MUST have a destination location. Multiple rules can use the same
destination. A "Target not found! Create, Abort or Hold until target is
ready?" popup occurs if the target location is not available. The Smart
Folder would temporarily store the file(s) and watch for the destination
location to become available. Great for dragging stuff to, and then later
connecting a removable drive, or if you have network shares that aren't
always available.

The Smart Folder will also keep a log of just where it's put each file, so a
user can find a file if it doesn't end up where expected. Also keep track of
where the file came from, so a user can "restore" file(s) to their original
location later.



As far as the program itself... Windows will allow you to drag files and
drop them on an EXE for processing, providing a very simple trigger for the
program.

If the program is started without any command line parameters, it can assume
that the user simply chose to "open" the Smart Folder. This would show the
destination targets and allow access to settings, etc.

If the program is started WITH command line parameters, it can assume that
it is a list of files/folders/etc. that should be processed.



Yes, I've put a bit of thought into this... I just wish I knew enough VB,
C#, etc... to create the actual code. (What would be the best VS 2005
language to use for this, assume I was equally proficient in each?)


Thanks!
 
G

Guest

Yes, I've put a bit of thought into this... I just wish I knew enough
VB, C#, etc... to create the actual code. (What would be the best VS
2005 language to use for this, assume I was equally proficient in
each?)

They're 99.9% identical because they use the same .NET framework. However,
C# does have 1 or 2 additional power features (pointers - not really used
unless you do a lot of native calls, and anonymous deletegates - VB.NET has
workarounds).

So the choice is upto you:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top