सभी फ़ाइलों को एक फ़ोल्डर से दूसरे फ़ोल्डर में स्थानांतरित करने के लिए सबसे अच्छा आदेश क्या है?कमांड लाइन का उपयोग करके मैं सभी फ़ाइलों को एक फ़ोल्डर से दूसरे फ़ोल्डर में कैसे स्थानांतरित कर सकता हूं?
मैं इसे बैच फ़ाइल के भीतर से करना चाहता हूं।
सभी फ़ाइलों को एक फ़ोल्डर से दूसरे फ़ोल्डर में स्थानांतरित करने के लिए सबसे अच्छा आदेश क्या है?कमांड लाइन का उपयोग करके मैं सभी फ़ाइलों को एक फ़ोल्डर से दूसरे फ़ोल्डर में कैसे स्थानांतरित कर सकता हूं?
मैं इसे बैच फ़ाइल के भीतर से करना चाहता हूं।
आप इसके लिए move
का उपयोग कर सकते हैं। help move
से प्रलेखन राज्यों:
Moves files and renames files and directories.
To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]filename1 Specifies the location and name of the file
or files you want to move.
destination Specifies the new location of the file. Destination
can consist of a drive letter and colon, a
directory name, or a combination. If you are moving
only one file, you can also include a filename if
you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.
/Y Suppresses prompting to confirm you want to
overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite
an existing destination file.
The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line. Default is
to prompt on overwrites unless MOVE command is being executed from
within a batch script.
एक उदाहरण के लिए निम्नलिखित ट्रांसक्रिप्ट देखें जहां यह शुरू में तीन होने के रूप में qq1
और qq2
निर्देशिका और कोई भी फ़ाइलें क्रमशः पता चलता है। फिर, हम move
करते हैं और हम पाते हैं कि तीन फ़ाइलों को qq1
से qq2
तक ले जाया गया है।
C:\Documents and Settings\Pax\My Documents>dir qq1
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:\Documents and Settings\Pax\My Documents\qq1
20/01/2011 11:36 AM <DIR> .
20/01/2011 11:36 AM <DIR> ..
20/01/2011 11:36 AM 13 xx1
20/01/2011 11:36 AM 13 xx2
20/01/2011 11:36 AM 13 xx3
3 File(s) 39 bytes
2 Dir(s) 20,092,547,072 bytes free
C:\Documents and Settings\Pax\My Documents>dir qq2
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:\Documents and Settings\Pax\My Documents\qq2
20/01/2011 11:36 AM <DIR> .
20/01/2011 11:36 AM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 20,092,547,072 bytes free
C:\Documents and Settings\Pax\My Documents>move qq1\* qq2
C:\Documents and Settings\Pax\My Documents\qq1\xx1
C:\Documents and Settings\Pax\My Documents\qq1\xx2
C:\Documents and Settings\Pax\My Documents\qq1\xx3
C:\Documents and Settings\Pax\My Documents>dir qq1
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:\Documents and Settings\Pax\My Documents\qq1
20/01/2011 11:37 AM <DIR> .
20/01/2011 11:37 AM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 20,092,547,072 bytes free
C:\Documents and Settings\Pax\My Documents>dir qq2
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:\Documents and Settings\Pax\My Documents\qq2
20/01/2011 11:37 AM <DIR> .
20/01/2011 11:37 AM <DIR> ..
20/01/2011 11:36 AM 13 xx1
20/01/2011 11:36 AM 13 xx2
20/01/2011 11:36 AM 13 xx3
3 File(s) 39 bytes
2 Dir(s) 20,092,547,072 bytes free
यह बहुत उपयोगी था और मैंने इस गाइड से बहुत कुछ सीख लिया। धन्यवाद। यह मुझे बहुत समय बचाया। – Chirag
लुक विंडोज पर move /?
और man mv
यूनिक्स प्रणालियों
यह आदेश destinationfolder को originalfolder में सभी फाइलों पर आ जाएगा उपयोग कर सकते हैं।
MOVE c:\originalfolder\* c:\destinationfolder
(। हालांकि यह नहीं होते नए स्थान पर किसी भी उप फ़ोल्डरों ले जाते हैं)
एक खिड़कियों में ले जाने के आदेश प्रकार के लिए निर्देश देखने के लिए यह संकेत कमान:
MOVE /?
move c:\sourcefolder c:\targetfolder
काम करेंगे, लेकिन आप इस तरह एक संरचना के साथ खत्म हो जाएगा:
c:\targetfolder\sourcefolder\[all the subfolders & files]
आप एक फोल्डर का सिर्फ सामग्री ले जाना चाहते हैं, तो इस यह करना चाहिए:
SET src_folder=c:\srcfold
SET tar_folder=c:\tarfold
for /f %%a IN ('dir "%src_folder%" /b') do move %src_folder%\%%a %tar_folder%
pause
(संभवतः) अवांछित क्रुकेट फ़ोल्डर संरचना से बचने के लिए, मैंने पाया कि एक एस्टेरिक्स इसे स्रोतफोल्डर में ठीक करता है, यानी 'c c: \ sourcefolder \ * c: \ targetfolder' स्रोतफोल्डर को स्थानांतरित करने के बजाय Sourcefolder की * सामग्री * को स्थानांतरित करेगा। – Therkel
उपयोग move
तो move <file or folder> <destination directory>
उपनिर्देशिका जाने के लिए, खाली फ़ोल्डर शामिल हैं, आप उपयोग कर सकते हैं प्रतिलिपि और निकालने का संयोजन:
# Setting up test env...
C:\> mkdir folder1 folder1\sub1 folder1\sub2 folder2
C:\> touch folder1\sub1\file.txt
# Copy "folder1" to "folder2", then remove "folder1"
C:\> xcopy /e folder1 folder2
C:\> rmdir /s /q folder1
रोबोकॉपी सबसे बहुमुखी प्रतीत होता है। सहायता
robocopy /?
robocopy SRC DST /E /MOV
ध्यान दें कि '/ MOV' विकल्प का अर्थ है "फ़ाइलों को ले जाएं, और उन्हें कॉपी करने के बाद स्रोत से हटाएं" और '/ E' का अर्थ है" उपनिर्देशिका कॉपी करें "। यह प्रभावी रूप से स्रोत फ़ाइलों और उसके उपफोल्डरों से सभी फ़ाइलों को स्थानांतरित करता है और गंतव्य फ़ोल्डर के नीचे फ़ोल्डर संरचना को पुन: प्रयास करता है, जिससे आपको खाली स्रोत फ़ोल्डर और संरचना मिलती है; यदि यह पहले से मौजूद नहीं है तो यह गंतव्य फ़ोल्डर भी बनाएगा। रोबोकॉपी बहुत शक्तिशाली है, [यहां प्रलेखन है] (https://technet.microsoft.com/en-us/library/cc733145 (v = ws.11) .aspx)। नोट विशेष रूप से '/ MOVE' विकल्प (जैसा उपर्युक्त'/MOV' के विपरीत है)। – Mesagoma
क्या ऑपरेटिंग सिस्टम और खोल में अन्य विकल्प देखें? –