-1

I have a simple zip extracting vbs which I found on another stackoverflow page and used it

ZipFile="%CD%\file.zip"
ExtractTo="%CD%"
set objShell = CreateObject("Shell.Application")
set FilesInZip=objShell.NameSpace(ZipFile).items
objShell.NameSpace(ExtractTo).CopyHere(FilesInZip)

But I noticed it doesn't work with cyrillic folders which is critical for me. Normally for batch I would just use chcp 1251 in the beginning of a script, but how would someone set a locale for vbs script?

2
  • I don't see how that script would work for any folder. In VBScript, you need to use the ExpandEnvironmentStrings method to work with environment variables. Regardless, you can simply save your VBScript script as Unicode (UTF-16LE) from any text editor in order to work with Unicode characters. That's also what Cmd /u does. Commented yesterday
  • @LesFerch I changed the script in my answer, the initial version was overcomplicated. Commented 23 hours ago

1 Answer 1

-2

Thank google search Gemini!
enter image description here

cmd /u /c echo CreateObject("Shell.Application"^).NameSpace("%CD%"^).CopyHere(CreateObject("Shell.Application"^).NameSpace("%CD%\file.zip"^).items^) > "%CD%\script.vbs"
Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.