Quantcast
Channel: Unable to execute FOR loop from batch file - Super User
Viewing all articles
Browse latest Browse all 3

Unable to execute FOR loop from batch file

$
0
0

I am trying to execute the following command from inside a batch file:

@echo off & for /f "delims=*" %A in ('dir /s /b') do echo %~fA %~zA >> "\path\to\output.txt"

I found this command from another thread. It prints out the entire file listing along with the file size.

I am able to execute this just fine when pasting into a command line window, but when I throw it into a batch file nothing happens. Am I missing something? Why would this failed when executed from a .bat?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images