Batch version of Windows script URL decryption

I have a script package that runs vlc for me on my network, the problem is that it opens based on the URLs in the browser. The browser automatically adds% 20 instead of the usual space, and I need to replace this with a regular space again in my script package before sending the file path to vlc.

Here is my code;

@echo off
set str=%1
set str=%str:~8%
set str=%str:%%20= %
START /D "C:\Program Files\VideoLAN\VLC\" vlc.exe %str%
pause

It is worth noting that this will work on Windows 7 and / or vista.

+3
source share
1 answer
@echo off
setlocal enabledelayedexpansion
set str=%~1
set str=%str:~7%
set str=!str:%%20= !
"C:\Program Files\VideoLAN\VLC\vlc.exe" "%str%"
pause

. script , ". , %. , start , , , VLC .

+7

Source: https://habr.com/ru/post/1759025/


All Articles