evilvoice Posted May 13, 2005 Posted May 13, 2005 (edited) Ok, this is a work in progress (for those who dunno what WIP means)...basically this is what is going on...I believe I stated this before, but here is an update...I guess if an admin wants to move it to my previous thread, then ok...back to the post now.My mom lives in another state so I have no way to really test this other than on my pc...more to why thats a problem later. She has a HP PhotoSmart 7700 printer with the memory card reader built in. She used to have HP Photo and Imaging installed, but I think its a bunch of bloat since all she wants to do is download her pictures into a year folder then a month folder (2005\Jan). So I worked on a batch for like a month only to lose it to QBFC (because under instructions from some people who said it was possible to change version info or the icon, which resulted in a corrupted exe) but oh well...I was really mad by this, not so much at the program or anyone other than myself for not testing it before erasing my cmd file...but thats what ya get when you dont keep backups.Now, she has like 4 removable drives, A:, E:, F: and G:...one is a SanDisk memory card reader and another is the HP...dunno what the other one is, unless its her mp3. well, the HP is G: but I wanted to make this universal so in the event that she gets more removable devices, reinstalls windows, or takes one off, it doesnt kill my batch. I cannot do something like the cdrom variable (a: b: c: d: e:...kinda thing) as it will result in a Windows Error (dealt with that for a while when using the FIND CDROM code) because if a disk isnt in every removable drive, windows will error and bring up a prompt (very annoying)...Nor can I use MountedDevices reg key since I am unsure if it will always have the same info for the drive. So what I have done is used %~d1 (must be this way since xxcopy doesnt like %DIR%*) to get the drive letter...which means if she drags the drive icon from My Computer to the batch, it will process that drive (Only way I can think of to do this), this is where I would like suggestions on how to get the drive.It gets the source drive (%~d1) then goes on to verify the correct folders are created. (again year\month for 4 years). It does not stop if the dir is already created, it will still open the memory card and see if there are any files it needs to copy to the month folders (ie, allows for multiple runs). SIDENOTE: I will include an eraser for the files that have already been downloaded, but right now, its in test mode. Then it uses xxcopy16 (since you do not have to install this...whereas the 32bit version you do) to copy only the files within a certain year-month and puts it in the correct folder.. Well anyways, here is the batch file...took me a month the first time, lost that one, and this one took about 4 hours.@ECHO OFFset DIR=%~d1set MP=%USERPROFILE%\My Documents\My PicturesIF NOT EXIST "%MP%"\2004 md "%MP%"\2004IF NOT EXIST "%MP%"\2005 md "%MP%"\2005IF NOT EXIST "%MP%"\2006 md "%MP%"\2006IF NOT EXIST "%MP%"\2007 md "%MP%"\2007for /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Jan (md "%%i"\Jan && xxcopy %DIR%\*.* %%~si\Jan /I /DO:%%~ni-1 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Jan /I /DO:%%~ni-1 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Feb (md "%%i"\Feb && xxcopy %DIR%\*.* %%~si\Feb /I /DO:%%~ni-2 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Feb /I /DO:%%~ni-2 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Mar (md "%%i"\Mar && xxcopy %DIR%\*.* %%~si\Mar /I /DO:%%~ni-3 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Mar /I /DO:%%~ni-3 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Apr (md "%%i"\Apr && xxcopy %DIR%\*.* %%~si\Apr /I /DO:%%~ni-4 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Apr /I /DO:%%~ni-4 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\May (md "%%i"\May && xxcopy %DIR%\*.* %%~si\May /I /DO:%%~ni-5 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\May /I /DO:%%~ni-5 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Jun (md "%%i"\Jun && xxcopy %DIR%\*.* %%~si\Jun /I /DO:%%~ni-6 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Jun /I /DO:%%~ni-6 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Jul (md "%%i"\Jul && xxcopy %DIR%\*.* %%~si\Jul /I /DO:%%~ni-7 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Jul /I /DO:%%~ni-7 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Aug (md "%%i"\Aug && xxcopy %DIR%\*.* %%~si\Aug /I /DO:%%~ni-8 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Aug /I /DO:%%~ni-8 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Sep (md "%%i"\Sep && xxcopy %DIR%\*.* %%~si\Sep /I /DO:%%~ni-9 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Sep /I /DO:%%~ni-9 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Oct (md "%%i"\Oct && xxcopy %DIR%\*.* %%~si\Oct /I /DO:%%~ni-10 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Oct /I /DO:%%~ni-10 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Nov (md "%%i"\Nov && xxcopy %DIR%\*.* %%~si\Nov /I /DO:%%~ni-11 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Nov /I /DO:%%~ni-11 /Q3 /ZSfor /D %%i in ("%MP%\20*") DO IF NOT EXIST "%%i"\Dec (md "%%i"\Dec && xxcopy %DIR%\*.* %%~si\Dec /I /DO:%%~ni-12 /Q3 /ZS) ELSE xxcopy %DIR%\*.* %%~si\Dec /I /DO:%%~ni-12 /Q3 /ZS1. This batch is NOT complete...%DIR% variable is set just for the drive and not the folder within memory cards, so that needs to be changed, which will be on my end once I find out what her folders are on the stick.2. It puts everything in My Pictures folder.3. It sets up 4 years with the 12 months in each year.4. xxcopy uses the year and month to determine what files to copy to what folder, it also does not bring up the summary at the end, or the title at the beginning (courtesy of /ZS) also, does not display files copied when copying (courtesy of /Q3...tho I think its overridden somewhere, cuz I did a /DEBUG and it says I was using /Q2)5. I believe the for commands are perfect, but suggestion are welcome...My purpose was to make this the EASIEST solution for her getting her pictures on her computer from the memory stick...it does not require user interaction other than dragging the drive to the batch...and this will be on her desktop so if you compare, dragging the drive would be the same as opening the program (maybe) and she has no menus to deal with.If anyone needs more explanation, let me know, and I will try to decipher what I wrote LOL.SIDENOTE: GOD I make some long posts Edited May 13, 2005 by evilvoice
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now