Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 663
  • Last Modified:

mv(linux) command under windows

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
victorbx
Asked:
victorbx
  • 4
  • 4
  • 2
  • +2
2 Solutions
 
sunnycoderCommented:
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
 
victorbxAuthor Commented:
well i need the regular way ,

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


victor
0
 
graemeboroCommented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sunnycoderCommented:
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
 
victorbxAuthor Commented:
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
 
_nn_Commented:
XXCopy can do that (see /RC option) : http://www.xxcopy.com
0
 
victorbxAuthor Commented:
i need the standard windows commands

builded batch files will be accepted as well

victor
0
 
sunnycoderCommented:
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
 
victorbxAuthor Commented:
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
 
sunnycoderCommented:
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
 
_nn_Commented:
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
 
suredazzleCommented:
You can ......mv *.*  /dir

or

mv *.* ../dir

It works!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 4
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now