Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I have 3 dlls in a folder "release"

abc.dll
def.dll
ghi.dll

I want the output in a variable to be like

/reference:abc.dll /reference:def.dll /reference:ghi.dll

What I have tried:

C#
I am able to get file names but not able to append "/reference:" with the dll names

To get the file names i am using "dir /b" command
Posted
Updated 28-Dec-16 1:15am
v2

That is not a standard format so you would need to write a batch script, most likely using the FOR command.
 
Share this answer
 
Got the solution

@echo off

set app=/reference:
setlocal enabledelayedexpansion
for /f "delims=" %%a in (' dir /b /a-d *.dll') do (
set oldName=%%a
call Set "finalname=%%finalname%% %app%!oldName!"
)
ECHO %finalname:~1%

pause >nul
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900