Solved

mv(linux) command under windows

Posted on 2003-11-14
12
638 Views
Last Modified: 2010-05-18
hi

can some tell me if i can move files and folder from one folders to another ?
( like linux )

mv /tmp/* /tmp2  /rf     -----> this command will move everyhing from /tmp to /tmp2


i am looking this command for windows/dos


victor


0
Comment
Question by:victorbx
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9746042
Hi victorbx,

there is a move command on windows
move /?

but I doubt it supports wildcards ... anyway you can download cygwin and get linux functionality on windows machine

Cheers!
Sunny:o)
0
 
LVL 4

Author Comment

by:victorbx
ID: 9746049
well i need the regular way ,

i need it for a corporate windows server to perform some task
on a file server


victor
0
 
LVL 4

Expert Comment

by:graemeboro
ID: 9746989
Is this an automated task or some-thing you are doing yourself?  You can use the standard MS-DOS commands in Windows 2k within a script or manually.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9747091
move c:\windows\temp\*.* c:\temp - This would move the files of c:\windows\temp to the temp directory in root, this is of course assuming you have the windows\temp directory.

http://www.computerhope.com/movehlp.htm#04
0
 
LVL 4

Author Comment

by:victorbx
ID: 9749377
well ,
this is an automated task with the scheduler...

" move c:\windows\temp\*.* c:\temp " ----> will not move folders as well

i need to move every thing

                                                  EXTRA 500 FOR THE ONE WHO WILL FIND A SOLUTION


VICTOR
0
 
LVL 16

Expert Comment

by:_nn_
ID: 9751030
XXCopy can do that (see /RC option) : http://www.xxcopy.com
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 4

Author Comment

by:victorbx
ID: 9753221
i need the standard windows commands

builded batch files will be accepted as well

victor
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9753260
xcopy source destination /E

This will copy everything "inside" source to destinations

rd /s source

will delete all file in source and its subdirectories


xcopy source destination /E
rd /s source

should do it for you
0
 
LVL 4

Author Comment

by:victorbx
ID: 9753286
i don't want to remove the directory ...
i want to delete everything in the directory including subfolder
and RD does not support wildcards


victor
0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 250 total points
ID: 9753297
mv in linux does exactly that ... removes old one and creates new one
once you have copied everything to a new destination, removing old one will have same effect as mv
rd /s will remove all sub directories so it has same effect as *

if you want linux shell kind of regex, then you will have to use some external package because windows does not support them
0
 
LVL 16

Accepted Solution

by:
_nn_ earned 250 total points
ID: 9754800
Just trying to improve sunny's suggestion : in a batch file

xcopy source destination /E
del /f /s /q source\*
for /f "delims=" %%a in ('dir /b source\*') do rd /s /q "source\%%a"
0
 
LVL 1

Expert Comment

by:suredazzle
ID: 22845052
You can ......mv *.*  /dir

or

mv *.* ../dir

It works!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now