Wednesday, August 7, 2013

Substring using bat command

>set fullname=c:\mypath\oldfile
>set changedname=%fullname:oldfile=newfile%
>echo %changedname%
c:\mypath\newfile
 
 
> set fullname=c:\mypath\oldfile
> set pathonly=%fullname:oldfile=%
> echo %pathonly%
c:\mypath\ 

Ref:http://stackoverflow.com/questions/2690382/substring-using-bat-command

No comments:

Post a Comment