Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 26th, 2009, 1:55 PM   #1
MFranklin1981
C Student
 
MFranklin1981's Avatar
 
Join Date: Feb 2007
Location: Seattle
Posts: 69
Rep Power: 8 MFranklin1981 is on a distinguished road
Moving multiple files with DOS command MOVE

All the documentation I have found for moving multiple files in dos says to separate the file names by a comma. However I can't seem to get it to work. What is wrong with my syntax?

Edit: assumes files and folders are in current working directory
dos Syntax (Toggle Plain Text)
  1. move 124*, 1779* Folder
Output
The syntax of the command is incorrect.
__________________
I'm running in the Seattle Rock 'n' Roll Marathon. Help me fight cancer by donating or forwarding this link on...
http://pages.teamintraining.org/wa/r...l09/mfrankltrt
MFranklin1981 is offline   Reply With Quote
Old May 27th, 2009, 3:03 PM   #2
Adak
Hobby Coder
 
Join Date: May 2006
Posts: 1,181
Rep Power: 10 Adak will become famous soon enough
Re: Moving multiple files with DOS command MOVE

The dos help shows using the comma separated file names for a multiple file move, but it doesn't work for me, either. Same error.

The only way I could get move to work with multiple files is by using wildcard char's:

C:\>move *.txt temp

would move all the .txt files from C:\ into the temp sub directory.
Adak is offline   Reply With Quote
Old May 27th, 2009, 5:12 PM   #3
MFranklin1981
C Student
 
MFranklin1981's Avatar
 
Join Date: Feb 2007
Location: Seattle
Posts: 69
Rep Power: 8 MFranklin1981 is on a distinguished road
Re: Moving multiple files with DOS command MOVE

Quote:
Originally Posted by Adak View Post
The dos help shows using the comma separated file names for a multiple file move, but it doesn't work for me, either. Same error.

The only way I could get move to work with multiple files is by using wildcard char's:

C:\>move *.txt temp

would move all the .txt files from C:\ into the temp sub directory.
Yeah, but I need it a bit more intelligent than that. what a pain!
__________________
I'm running in the Seattle Rock 'n' Roll Marathon. Help me fight cancer by donating or forwarding this link on...
http://pages.teamintraining.org/wa/r...l09/mfrankltrt
MFranklin1981 is offline   Reply With Quote
Old May 27th, 2009, 5:24 PM   #4
Arla
Expert Programmer
 
Arla's Avatar
 
Join Date: Mar 2005
Posts: 777
Rep Power: 10 Arla is on a distinguished road
Re: Moving multiple files with DOS command MOVE

You can always split your move commands into more than one? For example when you said
Move 124*,1779* folder

You can have
Move 124* folder
Move 1779* folder

It seems to be it doesn't like the folder after all the filenames (and if you omit the folder, it will move all the files into the last file... bleh!
__________________
I can remember, back in '22
They changed the law - came knocking on the door
In that same moment, the broadband seemed to go..
Phones all dead. Gone dizzy in the head..
Arla is offline   Reply With Quote
Old May 28th, 2009, 8:32 PM   #5
Adak
Hobby Coder
 
Join Date: May 2006
Posts: 1,181
Rep Power: 10 Adak will become famous soon enough
Re: Moving multiple files with DOS command MOVE

This move command format (move file1, file2, anotherDirectory), was new with DOS 6.0, and I'm starting to believe it was simply one of the DOS commands that was dropped to shrink DOS down to size for Windows.

Whether you use cmd.exe or command.com, if you enter "ver", it won't say "DOS 6.0" or something like that - it says "Windows ver. yada yada yada".

So it appears you can either use a for loop in a bat file, or you can use wildcards, but you can't move multiple explicit filenames in a single DOS command, with Windows XP. (I wasn't able to test this on any other version of Windows)

When is the Seattle R&R marathon?
Adak is offline   Reply With Quote
Old May 28th, 2009, 10:22 PM   #6
MFranklin1981
C Student
 
MFranklin1981's Avatar
 
Join Date: Feb 2007
Location: Seattle
Posts: 69
Rep Power: 8 MFranklin1981 is on a distinguished road
Re: Moving multiple files with DOS command MOVE

Quote:
Originally Posted by Adak View Post
This move command format (move file1, file2, anotherDirectory), was new with DOS 6.0, and I'm starting to believe it was simply one of the DOS commands that was dropped to shrink DOS down to size for Windows.

Whether you use cmd.exe or command.com, if you enter "ver", it won't say "DOS 6.0" or something like that - it says "Windows ver. yada yada yada".

So it appears you can either use a for loop in a bat file, or you can use wildcards, but you can't move multiple explicit filenames in a single DOS command, with Windows XP. (I wasn't able to test this on any other version of Windows)

When is the Seattle R&R marathon?
Ahh. Yeah I'm on version 5.1.2600

Thankfully I was able to find a solution to my problem that didn't involve dos batch scripting. Not that I'm a hater or anything. I think it's great for certain things but it's just so limited.

I used AutoIT.
http://www.autoitscript.com/forum/in...1&#entry688151

The marathon is June 27th! It should be fun. There is going to be a band every mile!
__________________
I'm running in the Seattle Rock 'n' Roll Marathon. Help me fight cancer by donating or forwarding this link on...
http://pages.teamintraining.org/wa/r...l09/mfrankltrt
MFranklin1981 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spreading a C++ program over multiple files lrh9 C++ 8 Feb 21st, 2009 3:30 PM
DOS batch files question Jabo Other Programming Languages 0 Apr 11th, 2008 11:53 PM
Multiple Source Files in a Project Varrickmana C++ 17 May 26th, 2006 9:27 AM
autoexecute multiple exe files badbasser98 C++ 4 May 5th, 2005 9:27 PM
multiple definition of variables in include files carlgreen C++ 3 Feb 26th, 2005 8:02 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC