0

When triyng to run iconv.exe under windows with the VBScript, the arguments don't go to executable.

Set SHL = CreateObject("WScript.Shell")

SHL.Run """iconv.exe"" -f utf-16 -t utf-8 in.txt > out.txt" 

I think it's error with quotes but can't find the right way.

Von
  • 15
  • 3

1 Answers1

1

.Run starts a process, not a shell. You need a shell for shell's features like re-direction. So:

Dim SHL  : Set SHL = CreateObject("WScript.Shell")
Dim iRet : iRet    = SHL.Run("%comspec% /c ""iconv.exe"" -f utf-16 -t utf-8 in.txt > out.txt", 0, True)
Ekkehard.Horner
  • 38,498
  • 2
  • 45
  • 96