1

@ Lankymart, Cody Gray, I am looking for a .vbs solution, and not a .bat solution.

I have a vbs (convert-ffmpeg.vbs) that I use to convert my video by dropping the file onto the icon. It only works if the filename is in English. If I drop a non-English, it doesn't work. The msgbox shows "?" instead of the actual name.

Option Explicit

Dim Convertor
Dim ConvertorExeName
Dim Parameters
Dim appendID
Dim lProcessID


Convertor="""D:\ffmpeg-20190427-8019395-win64-static\bin\ffmpeg.exe """
ConvertorExeName="ffmpeg.exe"

Parameters=" -c:v h264_qsv -global_quality 20  -b:a 128k -c:a aac "
appendID="ffmpeg"

Dim FileExt
Dim OutFile
Dim i,r,f

dim startTime 
startTime=Now

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
For i= 0 to WScript.Arguments.Count-1
    f=WScript.Arguments(i)  
    msgbox(f)

I created a bat file as a workaround as shown below. the chcp 65001 tells windows to expect unicode. May I know is there a way to indicate the code page the vbs file instead?

chcp 65001
FOR %%f IN (%*) DO (
convert-ffmpeg %%f
)
Leon
  • 33
  • 1
  • 1
  • 6
  • Can you share the `head`of `convert-ffmpeg.vbs`? – SNR Jun 28 '20 at 09:22
  • Tried [changing the DropHandler for .vbs files in the registry](https://stackoverflow.com/a/4366906/3439404). with no avail. However, **dropping a file on a shortcut to a VBScript file works**. Shortcut target could be `cscript.exe D:\bat\SO\62619252.vbs` or `wscript.exe D:\bat\SO\62619252.vbs` (use preferred _WScript Host_). Use full path to your `convert-ffmpeg.vbs` instead of `D:\bat\SO\62619252.vbs`. – JosefZ Jun 28 '20 at 15:08
  • The ```header``` has nothing much. I have added – Leon Jul 01 '20 at 03:43
  • @JoselZ, Sorry, I am not following. I drop a file onto a vbs shortcut, which is on my desktop, does not work. Do I need to modify something? – Leon Jul 01 '20 at 03:47

0 Answers0