S
S
Suil2021-03-04 10:21:12
cmd/bat
Suil, 2021-03-04 10:21:12

Through the batch file does not open folders with Cyrillic characters (Opening Explorer through the browser)?

Good afternoon.

I implement the opening of the explorer through the browser.

Did according to this instruction https://habr.com/ru/sandbox/114238/

First I registered the protocol in the system

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\myproto]
"URL Protocol"=""
@="URL:Myproto Protocol"

[HKEY_CLASSES_ROOT\myproto\shell]

[HKEY_CLASSES_ROOT\myproto\shell\open]

[HKEY_CLASSES_ROOT\myproto\shell\open\command]
@="\"C:\\myproto.bat\" \"%1\""


then created a batch file
@echo off
set "path=%~1"
setlocal enabledelayedexpansion
set path=%path:myproto://=%
set path=%path:"=%
set path=%path:/=\%
set path=!path:%%20= !
set path=!path:%%5C=\!
C:\Windows\explorer.exe "%path%"


Works only if there are no Russian letters in the path name.
I tried to display the path through echo, it displays this:
60408df5c52bd494152491.png

Please tell me how can I fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-03-04
@rPman

What is not clear then? you have the name url encoded, it needs to be decoded, from the bat language to winows it will be, to put it mildly, not easy, when, as in a normal programming language, it is quite possible.
No need to pervert, take the same php and use it, an excellent scripting language, the fastest, easiest, most logical. Ok, if you don't like php, take the c#/js#/vb# compiler which is built into windows C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\csc.exe ps Why did you delete the previous question?
$url=urldecode($argv[1])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question