On 14/11/2006, at 10:14 PM, David Pan wrote:

Does Windows accepts directory names with colons in them ?

No it seems not. So we need to do another delimitation. A quick and crude hack using a text file is below. Will work provided you have write permission in the current directory.

Also, although the batch file doesnt quite get this far, is this line..
supposed to be..
copy /V /Y %Card%* %DirName%

Yes, V0.02 is below.

regards,
Peter


:: CMD script for David Pan
:: Copyleft 2006 mobilecomputing.net.au
:: Dependency - now.exe available from MS resource kit

:: Let's keep our variables to ourselves
setlocal

:: Set your base directory here:
set BaseDir=c:\photos

:: Set the drive letter of your device:
set Card=f:\

:: Use now.exe as date is not reliable (depends on timezone etc)
:: Let's split up its output and assign some variables
for /F "tokens=1-5 delims=/ " %%i in ('now') do (
set DayofWeek=%%i
set Month=%%j
set Day=%%k
set Time=%%l
set Year=%%m)

@echo %Time% > temptime.txt
FOR /F "tokens=1-3 delims=:" %%i in (temptime.txt) DO set time=%%i%%j
del /Q temptime.txt

:: OK so here's our directory name, let's make it!
set DirName=%BaseDir%\%Year%%Month%%Day%%Time%
if not exist %DirName% mkdir %DirName%

:: Copy (with verify and overwrite) our photos:

copy /V /Y %Card%* %DirName%

:: Format the card:
format %Card%

_______________________________________________
Gpcg_talk mailing list
[email protected]
http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk

Reply via email to