Link to home
Start Free TrialLog in
Avatar of NLITech
NLITechFlag for United States of America

asked on

cannot make it run as a batch file

I am able to run the following from the command prompt with success, but I cannot make it run as a batch file any help making this run from a .bat file is appreciated

CD /D "D: \PDFBills"
set "source=D: \PDFBills\UnZip"
set "targetRoot=D:\ PDFBills\MonthlyPDFBills"
for %F in ("%source%\*") do (
  for /f "tokens=1,2,3 delims=/ " %A in ("%~tF") do (
    if not exist "%targetRoot%\%C\%A" mkdir "%targetRoot%\%C\%A"
    move "%~fF" "%targetRoot%\%C\%A"
  )
)

Lori
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NLITech

ASKER

Perfect! Thank you.
no problem