Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

batch stops on command "chcp 65001 >NUL" - Windows2003

2,258 views
Skip to first unread message

Petr Laznovsky

unread,
Sep 29, 2010, 10:53:18 AM9/29/10
to
Hi there,

there is batch which beginning like this:

@echo OFF
setlocal ENABLEDELAYEDEXPANSION
chcp 65001 >NUL
::
::
if "%1"=="" goto par_mis
if "%2"=="" goto par_mis
if "%3"=="" goto par_mis

under Win7 work fine, but under Windows2003 batch unexpectedly finish
after line:

chcp 65001 >NUL

No error message, %errorlevel% is 0
When i put REM before this command, than work fine.

Any ideas??

L.

foxidrive

unread,
Sep 29, 2010, 11:02:56 AM9/29/10
to

Try this: you should get the pause line.

@echo OFF
setlocal ENABLEDELAYEDEXPANSION
chcp 65001 >NUL

pause


--
Regards,
Mic

Petr Laznovsky

unread,
Sep 29, 2010, 11:16:11 AM9/29/10
to

No change, exact same behaviour...

John Gray

unread,
Sep 29, 2010, 12:05:48 PM9/29/10
to

Do you get anything if you remove the ">NUL" ?

Petr Laznovsky

unread,
Sep 29, 2010, 4:39:10 PM9/29/10
to

Yes: "Active code page: 65001"

Petr Laznovsky

unread,
Sep 29, 2010, 5:06:40 PM9/29/10
to

Frank P. Westlake

unread,
Oct 2, 2010, 9:15:31 AM10/2/10
to
"Petr Laznovsky" news:i7vjsq$4cu$1...@ns.felk.cvut.cz...

> chcp 65001 >NUL

> under Win7 work fine, but under Windows2003 batch unexpectedly finish
> after line:

Perhaps a year ago I did some experimenting (Windows XP) with Unicode in
the console and you might have seen my scripts posted here. I might have
discussed this problem in some of those messages. I don't now recall the
details but I did find that I could not get CMD to process any scripts
in the UTF-8 code page. I think one or more of those scripts I posted
were designed to help bypass that problem.

Frank


Message has been deleted

Frank Westlake

unread,
Oct 5, 2010, 9:27:07 AM10/5/10
to
Frank P. Westlake wrote:
> "Petr Laznovsky"

>
> > chcp 65001 >NUL
> > under Win7 work fine, but under Windows2003 batch unexpectedly finish
> > after line:
>
> Perhaps a year ago I did some experimenting (Windows XP) with Unicode in
> the console ...

It was probably Windows Vista, but I am uncertian.
> ...and you might have seen my scripts posted here. I might I think one or more of those scripts I posted


> were designed to help bypass that problem.

I think my bypass was used just to print UTF-8 in the console, but
your script could use that method to write itself into an ASCII file
then CALL that file. If you only want to print UTF-8 then the method
might be sufficient. I will.search Google Wednesday for the method
unless you say it is not necessary.

Frank

Petr Laznovsky

unread,
Oct 5, 2010, 11:44:35 AM10/5/10
to
Hi Frank,

may I ask you what post you are quote in those two lines??

>> Perhaps a year ago I did some experimenting (Windows XP) with
Unicode >> in the console ...

and

>> ...and you might have seen my scripts posted here. I might I think
>> one or more of those scripts I posted were designed to help bypass
>> that problem.


I did not see the original message in my news reader. Maybe I am lost
some important informations....

thanks P.L.

Frank P. Westlake

unread,
Oct 6, 2010, 10:01:40 AM10/6/10
to
"Petr Laznovsky" news:i8fh4u$2mcp$1...@ns.felk.cvut.cz...

> I did not see the original message in my news reader. Maybe I am lost
> some important informations....


I'll include that message below my signature. In that message I referred
to a previous discussion in this group; here is that discussion:
http://groups.google.co.uk/group/alt.msdos.batch.nt/browse_thread/thread/0d525c809d4f59d0.

The method from that discussion which might help you is from this
portion:

:: BEGIN SCRIPT :::::::::::::::::::::::::::::::::
CHCP 65001 & CMD /C"Type utf-8.txt" & CHCP 437
:: END SCRIPT :::::::::::::::::::::::::::::::::::

More script may be before and after.

Frank
"Petr Laznovsky" news:i7vjsq$4cu$1...@ns.felk.cvut.cz...

> chcp 65001 >NUL

> under Win7 work fine, but under Windows2003 batch unexpectedly finish
> after line:

Perhaps a year ago I did some experimenting (Windows XP) with Unicode in

the console and you might have seen my scripts posted here. I might have
discussed this problem in some of those messages. I don't now recall the
details but I did find that I could not get CMD to process any scripts

in the UTF-8 code page. I think one or more of those scripts I posted


were designed to help bypass that problem.

Frank


Frank Westlake

unread,
Oct 6, 2010, 10:33:25 AM10/6/10
to
The message you missed was sent via NNTP and the message you received
was send through Google, so this is a repeat of my NNTP reply -- now
via Google.

"Petr Laznovsky" news:i8fh4u$2mcp$1...@ns.felk.cvut.cz...


> I did not see the original message in my news reader. Maybe I am lost
> some important informations....

I'll include that message below my signature. In that message I


referred
to a previous discussion in this group; here is that discussion:
http://groups.google.co.uk/group/alt.msdos.batch.nt/browse_thread/thread/0d525c809d4f59d0.

The method from that discussion which might help you is from this
portion:

:: BEGIN SCRIPT :::::::::::::::::::::::::::::::::
CHCP 65001 & CMD /C"Type utf-8.txt" & CHCP 437
:: END SCRIPT :::::::::::::::::::::::::::::::::::

More script may be before and after.

Frank
"Petr Laznovsky" news:i7vjsq$4cu$1...@ns.felk.cvut.cz...

> chcp 65001 >NUL

> under Win7 work fine, but under Windows2003 batch unexpectedly finish
> after line:

Perhaps a year ago I did some experimenting (Windows XP) with Unicode
in

the console and you might have seen my scripts posted here. I might


have
discussed this problem in some of those messages. I don't now recall
the
details but I did find that I could not get CMD to process any scripts

in the UTF-8 code page. I think one or more of those scripts I posted


were designed to help bypass that problem.

Frank

0 new messages