Convert Absolute Path To Relative Path In Batch File


Answer :

@echo off
setlocal EnableDelayedExpansion
set Path_to_convert=c:\documents\mynicefiles\afile.txt
set Reference_path=c:\documents
set Result=!Path_to_convert:*%Reference_path%\=!
echo Result: %Result%


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable