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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pstein
Posts: 125
Joined: 09 Nov 2011 01:42

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

#1 Post by pstein » 17 Sep 2020 03:27

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

elzooilogico
Posts: 128
Joined: 23 May 2016 15:39
Location: Spain

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

#2 Post by elzooilogico » 17 Sep 2020 03:41

have you tried

Code: Select all

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

pstein
Posts: 125
Joined: 09 Nov 2011 01:42

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

#3 Post by pstein » 18 Sep 2020 02:21

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?

OJBakker
Expert
Posts: 90
Joined: 12 Aug 2011 13:57

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

#4 Post by OJBakker » 18 Sep 2020 03:12

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”

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

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

#5 Post by penpen » 18 Sep 2020 05:17

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

Post Reply