Computer Hope
Microsoft => Microsoft DOS => Topic started by: navin on September 09, 2008, 06:28:05 AM
-
Hello
Hope you can help, I want create a batch file that can copy all jpeg, gif and mp3 files from a network drive I: on various machines and return the information on a text file.
Please post me what commands to use. Thanks
-
you cuold lookup
ftp /?
or use xcopy if all the computers are networked.
FB
-
why the poll?
-
Thanks, but let me be clear what exactly I want to do is I need to run query on user's home drive which should return me with information on all the jpeg, gif and mp3 files stored on their drives.
how would I go about creating a batch file that can to this task for me. All your help will be much appriciated. Thanks
-
that's better...
where /t /r c:\ *.mp3 *.gif *.jpeg
FB
-
that's better...
where /t /r c:\ *.mp3 *.gif *.jpeg
FB
fireballs, the where command is not part of a standard Windows installation.
-
it's part of the standard 'vista home premium'... but i appologise if it doesn't work. try
dir /s c:\ | find .mp3
dir /s c:\ | find .gif
dir /s c:\ | find .jpg
FB
-
it's part of the standard 'vista home premium'... but i appologise if it doesn't work.
OK. I'm still using XP.
-
i didn't know it was only on vista, thanks
FB
-
Hi FB
I think it needs an asterix. In XP it returns an error when that's not present. Unvalid parameter. Did not manage to output any results to a txtfile, because that produces the same error.
dir /s c:\ | find *.mp3
dir /s c:\ | find *.gif
dir /s c:\ | find *.jpg
This works for me though.
dir *.mp3 /s/w/b/o >> list.txt
grt,
Dramklukkel.
-
Hi FB
I think it needs an asterix. In XP it returns an error when that's not present. Unvalid parameter. Did not manage to output any results to a txtfile, because that produces the same error.
dir /s c:\ | find *.mp3
dir /s c:\ | find *.gif
dir /s c:\ | find *.jpg
This works for me though.
dir *.mp3 /s/w/b/o >> list.txt
grt,
Dramklukkel.
hmmm it seems this is another incompatability between vista and XP. i have to admit that i missed off quotation marks around the ".mp3" but if i use "*.mp3" it doesn't find anything ??? >:(
also dir *.mp3 /s/w/b/o doesn't work for me.
FB
-
Guys Thanks very much for your help but I have tried all to no avail.
I am on windows 2000 and want the query to be returned on a text file
-
find needs quotes but you don't need find, because it may not do what you want.
dir | find ".mp3" will find any line in the output of dir which contains the 4 character string .mp3 so it would find this file which is not an mp3 file - horsecowcatdog.mp3.doc
You do need an asterisk for filespec wildcards as used by dir.
dir *.mp3 will find only files with the extension .mp3
-
to get the output in a text file use:
dir *.mp3>list.txt
dir *.jpg>>list.txt
dir *.gif>>list.txt
FB
-
Thanks, but let me be clear what exactly I want to do is I need to run query on user's home drive which should return me with information on all the jpeg, gif and mp3 files stored on their drives.
how would I go about creating a batch file that can to this task for me. All your help will be much appriciated. Thanks
Is this your school homework?
-
Is this your school homework?
using DOS? i don't think DOS has ever been taught in schools.
FB
-
i don't think DOS has ever been taught in schools.
On what do you base that statement?
A reply please.
-
i don't think DOS has ever been taught in schools.
On what do you base that statement?
A reply please.
I haven't been taught it.
May be different in America.
-
Schools in many countries all around the world use MS-DOS, Qbasic, batch language, Windows command prompt in their computer and IT courses. To say that "DOS" has never been taught in schools is a remarkably sweeping (and rather ignorant) statement.
-
Schools in many countries all around the world use MS-DOS, Qbasic, batch language, Windows command prompt in their computer and IT courses. To say that "DOS" has never been taught in schools is a remarkably sweeping (and rather ignorant) statement.
True, I was just adding that it is not in the English curriculum.
-
True, I was just adding that it is not in the English curriculum.
Well, they teach it in at least one secondary school in Bristol that I know about.
-
True, I was just adding that it is not in the English curriculum.
Well, they teach it at least one secondary school in Bristol that I know about.
Well obviously I am wrong.
I forgot schools can change their curriculum, and obviously if an IT technician or teacher feels teaching DOS would be beneficial then they can teach it, with the backing of the headteacher and or governing body.
-
You clearly haven't noticed the large number of DOS homework questions that are posted in this part of the forum.
-
Wrong, I have.
But I don't see why you are getting shirty with me, I didn't make the assumption in the first place.
-
Wrong, I have.
But I don't see why you are getting shirty with me, I didn't make the assumption in the first place.
I'm sorry, I didn't mean to sound shirty. Sorry if it came over that way. I posted in haste. Also you're right, it was our friend who hasn't answered who made the assumption.
-
yup i was wrong, sorry. I guess we both posted in haste.
FB
-
Still, there's always a silver lining - our post counts have gone up :)
-
Thanks for your help, I have now managed to create the batch file BUT the main issue is I neet to connect to user's I drives, approximatelt 200 drives to obtain the information. so this is what the objective is.......Run batch file to connect to I:\servername\username$ ......obtain list of jpeg on this drive .....copy on text file on my C:\drive.
I have around 200 different username$ to connect to on five different servernames.
Please assist as your previous input has been very helpful. Thanks to all.
-
Hi guys thanks for your help,
I really want to access user's homes drives to obtain the information, the objective is:
use batch file to connect to user's home drive: \\servername\username$
copy information on all jpeg files on a text file and return to me on my home drive.
There are approximately 200 users on five different servers.
All your help is appriciated. Thanks