@echo off & setlocal enableextensions
::
:: The local target file
set filename_=%~1
::
:: Process
for /f "tokens=*" %%f in ("%filename_%") do (
set dr_=%%~df
set ph_=%%~pf
set nx_=%%~nxf)
set
"fileurl_=file:///%dr_:~0,1%:%ph_:\=/%%nx_%
"
set
"fileur2_=file:///%dr_:~0,1%:%ph_:\=/%%nx_%
"
::
:: Display the results
echo %filename_%
echo %fileurl_%
::
:: Build a Visual Basic Script for lowercase
set vbs_=%temp%\tmp$$$.vbs
set skip=
findstr "'%skip%VBS" "%~f0" > "%vbs_%"
::
:: Run it with Microsoft Windows Script Host Version 5.6
cscript //nologo "%vbs_%" "%fileur2_%"
::
:: Clean up
for %%f in ("%vbs_%") do if exist %%f del %%f
endlocal & goto :EOF
'
'The Visual Basic Script
WScript.Echo LCase(WScript.Arguments.Unnamed(0)) 'VBS
The output could be e.g.
C:>C:\_D\BAS\CMDFAQ.CMD C:\_G\WWW\~ELISANET\INFO\TSCMD183.HTML
C:\_G\WWW\~ELISANET\INFO\TSCMD183.HTML
file:///C:/_G/WWW/~ELISANET/INFO/tscmd183.html
file:///c:/_g/www/~elisanet/info/tscmd183.html
@echo off & setlocal enableextensions
set fileurl_=%~1
echo %fileurl_%
set filename_=%fileurl_:/=\%
set filename_=%filename_:file:\\\=%
echo %filename_%
endlocal & goto :EOF
The output could be e.g.
C:\_M>C:\_D\BAS\CMDFAQ.CMD "file:///C:/_G/WWW/~ELISANET/INFO/tscmd183.html"
file:///C:/_G/WWW/~ELISANET/INFO/tscmd183.html
C:\_G\WWW\~ELISANET\INFO\tscmd183.html