Window.location.pathname gives a "/" before path.make sure "/" is appended in your href value, else compare by removing the slash.I have tried using following code and it worked.Please check,
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script>
$(function(){
$('li').each(function() {
var href = $(this).find('a').attr('href');
console.log(window.location.pathname);
if (href == window.location.pathname) {
$(this).addClass('current');
}
});
});
</script>
<style>
.current {
background:red !important;
color:blue !important;
}
</style>
</script></head>
<body>
<ol>
<li><a href="/C:/Users/akhil.mittal/Desktop/a.html">akhil</a></li>
<li><a href="/C:/Users/akhil.mittal/Desktop/a.html">akhil1</a></li>
<li><a href="/C:/Users/akhil.mittal/Desktop/a.html">akhil2</a></li>
<li><a href="/C:/Users/akhil.mittal/Desktop/a.html">akhil3</a></li>
</ol></body>
</html>