1.

Solve : Use Full path in For Loop?

Answer»

Hi, I'm been have trouble trying to use the folder path instead of pushd. If possible, I would like to use  the full path in the for loop instead of using the PUSHD command.

Code: [Select]echo on

pushd "\\klpr32\new folder\" && (
for %%a in (*) do (
if not exist "\\klpr32\new folder\newfiles\%%~na.txt" for %%b in ("%%~na.*") do type "%%b" >>"\\klpr32\new folder\newfiles\%%~na.txt"
)
popd
)

Not understanding your question.
Ditto...Me also.  EXPLAIN in Engerlish what the aim of the task is. Quote from: foxidrive on April 07, 2015, 06:55:16 PM

Me also.  Explain in Engerlish what the aim of the task is.
I would EVEN ACCEPT Igpay AtinlayThis might infest your bed with bugs and drink your last dram of liquor, but it's a guess at what you want to do.

Giving a clear explanation is far better than posting code that doesn't work - because broken code with no clear explanation is like giving your Ikea assembler every odd number page of the plans for your Ikea widget, and burning the even numbered pages.  It's a good thing that they get paid by the hour.

Code: [Select]echo off
for %%a in ("\\klpr32\new folder\*") do (
   PROCESSING "%%~a"
 ECHO  if not exist "%%~dpa\newfiles\%%~na.txt" copy /b "%%~na.*" "%%~dpa\newfiles\%%~na.txt"
)
pause

Even Latin PIGS are accepted legal tender here.


Discussion

No Comment Found