Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows CMD: Get relative path from absolute path

How do i obtain the relative path from an absolute path, e.g. convert 'C:\absolute\path\file.ext' to 'path'?

Thanks for your consideration

edit: i'd like to recursivly scan a directory for a certain filetype and then create symlinks for these folders containing this filetype. the symlinks should be named like the directory containing the filetype.

like image 853
DapperDan Avatar asked Jan 27 '11 12:01

DapperDan


1 Answers

This function works
DosTips.com :MakeRelative

It compares both pathes and removes the identical front.
Then it adds "..\" for each non matching part.

like image 51
jeb Avatar answered Oct 25 '22 01:10

jeb