Computing.Net > Forums > Programming > Move If

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Move If

Reply to Message Icon

Name: Scott Colwell
Date: November 2, 2009 at 07:42:19 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Can anyone help me with a batch file that moves files if they are a certain string of names. I have files called repFS1.dat to repFS1000.dat and one file called repFSlist.dat and I want all 1000 + 1 files to be moved from one file to another file. I've tried google, but can't seem to get the suggestions to work. Thanks,



Sponsored Link
Ads by Google

Response Number 1
Name: jcgun
Date: November 2, 2009 at 07:59:51 Pacific
Reply:

you can use the IF function

IF '%ATT1%'=='WHAT THE ATTRIBUTE CONTAINS' COMMAND TO PERFORM IF IT HAPPENS

for example:
if '%filename1%'=='HELLO!' echo Hello!!


0

Response Number 2
Name: Scott Colwell
Date: November 2, 2009 at 08:05:34 Pacific
Reply:

How do you incorporate that into the MOVE command though?

I tried
if '%repfs%'==MOVE C:\Documents and
Settings\User\Desktop\batch test\ "C:\Documents and
Settings\User\Desktop\batch test\"

But that doesn't seem to work.


0

Response Number 3
Name: klint
Date: November 2, 2009 at 09:39:33 Pacific
Reply:

Use wildcards.

MOVE "source\repfs*.dat" "destination\"


0

Response Number 4
Name: Scott Colwell
Date: November 3, 2009 at 07:38:37 Pacific
Reply:

Here's what I have but it is still not working. Any thoughts?
Thanks.

MOVE "C:\batch test\repFS*.dat" "C:\batch test\"


0

Response Number 5
Name: klint
Date: November 3, 2009 at 12:39:22 Pacific
Reply:

Why are you trying to move the files to the same folder? That's
not moving.


0

Related Posts

See More



Response Number 6
Name: Scott Colwell
Date: November 3, 2009 at 14:21:03 Pacific
Reply:

Wow...that was of really stupid of me wasn't it. Thanks again.


0

Sponsored Link
Ads by Google
Reply to Message Icon

DLL protection Accessing to a network


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Move If

Batch to move if enough space. www.computing.net/answers/programming/batch-to-move-if-enough-space/17435.html

moving file bat question www.computing.net/answers/programming/moving-file-bat-question/15908.html

move files with same name www.computing.net/answers/programming/move-files-with-same-name/18856.html