|First, post the script you're trying to run, with some sample file/folder names & paths.|
I am guessing you want to drop a folder-name to the batch and have it process all files in that folder. If that is indeed the case, the batch needs to determine if the input is a single file or a folder, and if it's a folder, it needs to enumerate the files explicitly. (batch won't split a folder into it's component files automatically. you have to code for that.) By this: "but when there are >1, it just prints the list of files with full path", i am assuming you mean dropping a directory-name onto the batch. Here's a sample snippet that demonstrates what I feebly attempted to communicate:
@echo off & setlocal
if "%~a1" equ "d--------" (
:: process as a directory/folder feed, not a single file
echo %1 is a directory...
for %%a in (%1\*.*) do (
echo processing %1\file: -------- %%a
) else (
:: here is processes only a single file
::-------- end snippet
I tested this, using drag/drop which I'm not used to using. Apparently, D/D automatically surrounds the space-sep word-group with quotes, since only one token is offered to the batch. Cmd requires explicit quotes to group space-separated words into one token, since multiple tokens are available to the batch from CMD. It's a big bunch of crock initiated by the introduction of spaces into file/folder-names which I continue to deplore and rant against.
message edited by nbrane