Skip to content

Compressed2TXT and WinXP #3

@Zphere1

Description

@Zphere1

I recently used your very useful tool to encode files in a windows shell script (cmd).
It's nice to see that a complete folder and it's file content can be compressed/encoded and later decompressed/decoded in the execution directory of the resulting bat file.
However, you stated compatibility since Win7 and upwards.

Just want to inform you, that your ps code also works under windows xp (SP3) environment with some limitations.
Without modification of the header line in the resulting bat file it will break because you try to switch cp UTF8 via CHCP command inside the cmd/bat file. This is an XP bug; documentations are really difficult to find.
Switching to cp 65001 only works inside the console window itself.
Trying to switch to cp 65001 within any cmd/bat file either breaks further processing or maybe lead to really unexpected results.
Replacing the CHCP value with e.g. 1252 works and makes the batfile go again.
However, when trying to decompress/decode a folder and its file content WinXP extracts only the files in the execution directory.
Till Win7 and upwards also the encoded folder is extracted.

I thought this might be some useful information for you to improve your code in the future.
I assume the cp 65001 setting was made to allow ps to handle multibyte chars in file- or folder names correctly.
Although it seems that you have to waive on this setting in xp, as long as anybody knows his current ACP and uses file/folder names to compress/encode that matches the ACP inside the batch/bat file anything should work flawlessly I think.
You might add some checking procedures?
...just some thoughts of mine.

So far, thanks for your really useful code
Zphere

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions