Link to home
Start Free TrialLog in
Avatar of SStory
SStoryFlag for United States of America

asked on

FOR command and SET command in a batch file

I have the copy part working due to an answer in a previous question
FOR %%A IN (%*) DO (
       rem copy the file
      COPY %%A "%temp%\~1234WSS4321\%%~nxA"
      SET X=%X% %%~nxA
)

the set part does not work.... why?  How can I do it.
I need the environment variable to =
filename1.tif filename2.tif filenamex.tif
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

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 SStory

ASKER

You're right about what I want to do, but it didn't work.
I am getting:
'~nxA' is not recognized as an internal or external command,
operable program or batch file.
You have made my day! 
You are definitely Mr. Batch Expert in my book.
I looked through a lot of docs and help and COULD not figure out what to do!
 
Thanks a bunch.
Now with this batch file and some free tools from TiffLib I can let my users take multiple TIFF files and convert them to one PDF, at no cost!!!

Open in new window

Avatar of SStory

ASKER

Oops... Sorry.. At first I thought it wasn't work. I had && instead of %%
Disreguard the comment in the above and read the code snippet..
I goofed.

Thanks.
Avatar of SStory

ASKER

Awesome! You have made my day!  I looked at lots of docs and help but just
couldn't get it. Now my TIFFS to PDF will work for users in a simple way.

Thanks again!