![]() |
![]() OCAU News - Wiki - QuickLinks - Pix - Sponsors |
|
|||||||
| Notices |
|
Sign up for a free OCAU account and this ad will go away! Search our forums with Google: |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Member
Join Date: Jun 2001
Location: Melbourne, Australia
Posts: 7,685
|
I'm trying to write a very simple bat file that can be executed to automatically go through every *.avi on a CD/DVD that is inserted and copy them to my harddrive on my Media PC.
It basically, scans the DVD, creates a directory for each AVI on the disc and then copies it to the harddrive, if it doesn't already exist. This works great for filenames without spaces. But if it has a space it only takes the filename up to the first space and then obviously doesn't copy correctly. I can't find much info on how to get this to work.... It's basically 2 bat files. The first one Code:
for /f %%a IN ('dir /b/s e: *.avi') do C:\copyfile %%~da %%~sa %%~xa
Code:
d: cd "SD Movies" IF EXIST %2 GOTO END MD %2 ECHO COPYING %2 TO D:\SD MOVIES COPY %1\%2%3 .\%2\ :END ECHO %2 ALREADY EXISTS So as I said if the filename has no spaces it works fine, but if it has spaces the %%~sa variable only pulls the first portion of the name... Any ideas? |
|
|
|
| Join OCAU to remove this ad! |
![]() |
| Bookmarks |
|
Sign up for a free OCAU account and this ad will go away! |
| Thread Tools | |
|
|