diogo-fernan/ir-rescue

Unexpected exit when running `chcp 65001 > NUL 2>&1`

pe3zx opened this issue · 3 comments

pe3zx commented

Hi Diogo!

I did run ir-rescue-win-v1.4.4.bat on Windows Server 2008 R2 and got unexpected exit after executing chcp 65001 > NULL 2>&1. It looks like when trying to execute chcp 65001 > NULL 2>&1, the batch script will not work too (on the same cmd.exe).

If you need any clarification, please don't hesitate to ask me.

Update 1: My workaround is to remove this line and the batch script will work fine.

Hi there!

I have no access to a Windows Server 2008 R2 to troubleshoot the command. Could you please run chcp, chcp 1252, chcp 65001 and chcp 65001 > NULL 2>&1 on a command line window and circle back with the output?

Thanks

pe3zx commented

Running those commands on the same cmd.exe will show the output like this:

Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>chcp
Active code page: 437

C:\Users\Administrator>chcp 1252
Active code page: 1252

C:\Users\Administrator>chcp 65001
Active code page: 65001

C:\Users\Administrator>chcp 65001 > NULL 2>&1

C:\Users\Administrator>chcp
Active code page: 65001

C:\Users\Administrator>cd ir-rescue\win

C:\Users\Administrator>ir-rescue-win-v1.4.4.bat
*nothing here*
C:\Users\Administrator>

I've just found another issue which happened because some of util on Sysinternals is too new to run on the target system. It's not solely ir-rescue's issue but I would be appreciate if you mention this on README.md.

So, it looks like chcp runs without issue on the command line. What then makes you say that ir-rescue breaks on that particular line of code? In fact, the preceding command of chcp on https://github.com/diogo-fernan/ir-rescue/blob/master/win/ir-rescue-win-v1.4.4.bat#L40 should clear the command line window, which does not appear to happen as per your output. This means that the script might be exiting earlier in the code.

The best way to debug this would be to place some echo commands within the :main label on https://github.com/diogo-fernan/ir-rescue/blob/master/win/ir-rescue-win-v1.4.4.bat#L3 in order to narrow down troubleshooting. Could you do this?

The README.md describes that the Sysinternals utilities must be downloaded beforehand. Whether or not they no longer work on older versions of Windows is something that is out of my control, though it would be expected for support to be maintained for most features.