General Question
Why isn't this batch script working?
I’m making this script to automatically sort recovered files, but it gives parse errror each time. I need it to copy all files from subdirectories, and not ask to overwrite. Please help.
@echo off
title File Organizer
color 0a
echo.
echo [][][][][][][][][][][][][][][][]
echo [] /\ []
echo [] [] []
echo [] [][] []
echo [] [] [] []
echo [] [] [] []
echo [] [] [] []
echo [] /\][][][][/\ []
echo []// \\[]
echo [] []
echo [] []
echo [] []
echo [] []
echo [] []
echo [] []
echo [][]
echo []
ping localhost -n 2 >nul
:FilePath
cls
echo Enter The File Path To Be Sorted:
echo.
set /p FilePath=
echo.
echo Is %FilePath% Correct? (Y/N)
set /p note=
if ’%note%’==‘Y’ GOTO Sort
if ’%note%’==‘y’ GOTO Sort
if ’%note%’==‘N’ GOTO FilePath
if ’%note%’==‘n’ GOTO FilePath
:Sort
echo Now Sorting Files. Folders Will Be Created In Current Directory.
echo.
echo Creating Directories…
MKDIR FileSort
MKDIR FileSort\Compressed
MKDIR FileSort\Music
MKDIR FileSort\Video
MKDIR FileSort\Pictures
MKDIR FileSort\Documents
echo.
echo Complete
echo.
echo Now Beginning Sorting…
ping localhost -n 2 >nul
echo.
echo Sorting Music
echo.
XCOPY /S /Y “%FilePath%\*.mp3” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.wav” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.caf” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.m4a” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.m4r” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.aac” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.aiff” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.au” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.3gp” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.flac” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.m4p” “FileSort\Music\”
XCOPY /S /Y “%FilePath%\*.mma” “FileSort\Music\”
echo.
echo Sorting Video
echo.
XCOPY /S /Y “%FilePath%\*.aaf” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.3gp” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.avi” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.flv” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.m4v” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.mkv” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.mov” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.mpeg” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.mpg” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.mpe” “FileSort\Video\”
XCOPY /S /Y “%FilePath%\*.wmv” “FileSort\Video\”
echo.
echo Sorting Pictures
echo.
XCOPY /S /Y “%FilePath%\*.jpg” “FileSort\Pictures\”
XCOPY /S /Y “%FilePath%\*.jpeg” “FileSort\Pictures\”
XCOPY /S /Y “%FilePath%\*.png” “FileSort\Pictures\”
XCOPY /S /Y “%FilePath%\*.bmp” “FileSort\Pictures\”
XCOPY /S /Y “%FilePath%\*.gif” “FileSort\Pictures\”
XCOPY /S /Y “%FilePath%\*.tiff” “FileSort\Pictures\”
echo.
echo Sorting Compressed Files
echo.
XCOPY /S /Y “%FilePath%\*.zip” “FileSort\Compressed\”
XCOPY /S /Y “%FilePath%\*.rar” “FileSort\Compressed\”
XCOPY /S /Y “%FilePath%\*.7zip” “FileSort\Compressed\”
echo.
echo Sorting Documents
echo.
XCOPY /S /Y “%FilePath%\*.doc” “FileSort\Documents\”
XCOPY /S /Y “%FilePath%\*.docx” “FileSort\Documents\”
XCOPY /S /Y “%FilePath%\*.ppt” “FileSort\Documents\”
XCOPY /S /Y “%FilePath%\*.pptx” “FileSort\Documents\”
XCOPY /S /Y “%FilePath%\*.xls” “FileSort\Documents\”
XCOPY /S /Y “%FilePath%\*.xlsx” “FileSort\Documents\”
XCOPY /S /Y “%FilePath%\*.txt” “FileSort\Documents\”
Pause>nul
12 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.