Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to handle directory names with spaces

Status
Not open for further replies.

egodette

Technical User
Jun 12, 2002
222
US
The below code works perfect except if the folder has spaces in the name.
This small program looks for file names that are duplicated with different extensions.
example -- document.pdf document.tif


FOR /F %%i in ('dir /b /s *.pdf') do (
IF EXIST "%%~dpni.tif" (
echo "%%~dpni.tif" >>c:\test.txt
)
)

Any ideas on how to work with directory names that have spaces?
 
I'm assuming this is in a batch file?

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top