Solved need user to specify file location

March 7, 2013 at 13:38:30
Specs: Windows 7
this is the current script i am using

@echo off
setlocal enabledelayedexpansion
pushd "C:\Users\"
for %%a in (*) do (
set fldr=%%~na
set fldr=!fldr:~0,7!
md "!fldr!"
move "%%a" "!fldr!"

i need this line to have user input to specify as to where the files are located
pushd "C:\Users\"

and this one for user to specify how many characters of file name to read
set fldr=!fldr:~0,7!

See More: need user to specify file location

Report •

March 7, 2013 at 17:52:40
✔ Best Answer
If you want to prompt for it:

set uzrz=
set /p uzrz="Please enter the full-path of the directory to be processed: "
set len=
set /p len="Please enter the (maximum) length for subfolder names: "
echo all files in %uzrz% will be moved to a subdirectory of the same name (approximate to the first %len% characters)

(this would be between lines two and three of your posted script)

Report •
Related Solutions

Ask Question