Page 1 of 1

How to pass "chcp 1252" command to START "" /B /WAIT program?

Posted: 17 Sep 2020 03:27
by pstein
I am running a batch script.
Part of this batch script is the call of an external cmdline-only program.

I start this program from batch script with

Code: Select all

start "" /NORMAL /B /WAIT D:\foobar\myprog.exe /parm1 /parm2 someparm
It works.

However the output of that program contains german Umlaute which are not displayed correctly.
If it would run in the current CmdPrompt I could write at the top

Code: Select all

>nul chcp 1252
Since it runs in a different CmdPrompt (=environment context) I have a problem.

How can I pass the command

>nul chcp 1252

most easily for the new created Sub-CmdPrompt?

Is there a way to pass it in the start command similar to

Code: Select all

start "" /NORMAL /B /WAIT ">nul chcp 1252" && D:\foobar\myprog.exe /parm1 /parm2 someparm
This seems not to work

Peter

Re: How to pass "chcp 1252" command to START "" /B /WAIT program?

Posted: 17 Sep 2020 03:41
by elzooilogico
have you tried

Code: Select all

start "" /NORMAL /B /WAIT ">nul chcp 1252 & D:\foobar\myprog.exe /parm1 /parm2 someparm”

Re: How to pass "chcp 1252" command to START "" /B /WAIT program?

Posted: 18 Sep 2020 02:21
by pstein
Yields popup

"Windows cannot find '>nul chcp 1252 & ......'
Make sure you typed the name correctly and then try again"

Same with

start "" /NORMAL /B /WAIT ">nul chcp 1252 && D:\foobar\myprog.exe /parm1 /parm2 someparm”

or

start "" /NORMAL /B /WAIT ">nul chcp 1252" & D:\foobar\myprog.exe /parm1 /parm2 someparm


Any other idea?

Re: How to pass "chcp 1252" command to START "" /B /WAIT program?

Posted: 18 Sep 2020 03:12
by OJBakker
try these

Code: Select all

start "" /NORMAL /B /WAIT >nul "%windir%\system32\chcp.com" 1252 & "D:\foobar\myprog.exe /parm1 /parm2 someparm”
start "" /NORMAL /B /WAIT >nul "chcp" 1252 & "D:\foobar\myprog.exe /parm1 /parm2 someparm”
start "" /NORMAL /B /WAIT >nul chcp 1252 & "D:\foobar\myprog.exe /parm1 /parm2 someparm”

Re: How to pass "chcp 1252" command to START "" /B /WAIT program?

Posted: 18 Sep 2020 05:17
by penpen
If i remember right, then start does not support shell/batch commands, so you might have to start the command interpreter:

Code: Select all

start "" /NORMAL /B /WAIT  "cmd /c">nul chcp 1252 && D:\foobar\myprog.exe /parm1 /parm2 someparm""
penpen