Need batch file for flash drive

March 15, 2010 at 17:39:29
Specs: coding
i want a batch file to do that:
i want batch to find my flach usb ( my flash have file his name (saleem.txt)
when the batch know my flash xcopy all the docx in the hard disk content word (philadelphia) to my flash

am try that but does no worked:


@echo off
FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO
IF EXIST %%h:\saleem.txt (
for %%x in (*.docx) do (
type %%x>>h:\new.docx

)
)

and that but does not worked:

FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST %%h:\saleem.txt ( for %%x in (*.docx) do type %%x>>%%h:\new.docx )

plz help me plzzzz


See More: Need batch file for flash drive

Report •


#1
March 16, 2010 at 05:15:29
Try starting with this line first:

@echo off & setLocal EnableDELAYedeXpansion


=====================================
Helping others achieve escape felicity

M2


Report •

#2
March 16, 2010 at 08:23:36
i think the wrong in cood coz does not worked plz help

Report •

#3
March 16, 2010 at 17:28:47
I won't be adapting it but you may want to have a look at this script:

View: http://pastebin.com/jWeic1R8
Download: http://pastebin.com/download.php?i=...


Report •

Related Solutions

#4
March 16, 2010 at 17:36:24
i think my q is identyifying what i need
i know my q is very defecult but read it and try to answer
plz

Report •

#5
March 16, 2010 at 17:39:42
lsn i make a saleem.txt to lest the batch file searching about that file and set the flash with her name drive
so and the second thing is when am know my flsh i want to make a copy from all the harddisk to my flash whos files (*docx) content word "hi"
the idea to make a copy from all harddisk to my flash from any files (*.docx) content word "hi" to stolen the all files (*.docx) with pictures

Report •

#6
March 16, 2010 at 22:04:47
Do you realize that .docx is a binary format that you:

a) Won't be able to read properly under batch script.

b) Won't be able to write to properly under batch script.


Report •

#7
March 17, 2010 at 05:34:10
ok am understand:
ok so help me in another choice:
batch to know my flash usb ( she have a file his name is saleem.txt - to make command ( if exist) to find a flash))
and xcopy all the *.docx to my flash but xcopy them to folder his name when he found that docx like that:
hi.docx exist in drive c:
and bye.docx exist in drive and folder like that d:\saleem\

so when xcopy them doing this in my flash w consider my flash drive is h:
so that files will be on my flash like this:
h:\c\hi.docx
and second file will be :

h:\d\saleem\bye.docx

am make the batch like this but i have so problems like:
copy all docx to all drives so test that:

FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST %%h:\saleem.txt ( for %%x in (C D E F G H I J K L M N O P Q R S T U V W X Y) do ( xcopy/e/s/c/h/r/i/k/y %%x:\*.docx %%h:\zzz ) )


so i think we must use command ( set)
thats mean when the batch found the saleem.txt must set flash and do xcopy only for flash

help help help


Report •

Ask Question