### What happened?

I was trying to cp a from a Windows Pod to the Windows localhost. But it failed.


```
kubectl.exe cp --kubeconfig .\kubconfig -n namespace-win pod-20240509-120334-779546rrfsc:C:\\data\\0509-1065.log 0509-1065.log
```

It showed

```
tar: Removing leading drive letter from member names
error: tar contents corrupted
```

### What did you expect to happen?

I want to copy the file to the localhost.

### How can we reproduce it (as minimally and precisely as possible)?

Windows 11 localhost
Windows Pod.


### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$(powershell) kubectl version
# paste output here

Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Unable to connect to the server: dial tcp 127.0.0.1:6443: connectex: No connection could be made because the target machine actively refused it.
```
</details>


### Cloud provider

<details>

</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

BuildNumber  Caption                      OSArchitecture  Version
22621        Microsoft Windows 11 Professional  64-bit          10.0.22621
```
</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>

kubectl cp a file from a Windows Pod to Windows 11 localhost failed
This is a GitHub Issue
repo:kubernetes
owner:kubernetes
Title : kubectl cp a file from a Windows Pod to Windows 11 localhost failed
Issue date:

--- start body ---
### What happened?

I was trying to cp a from a Windows Pod to the Windows localhost. But it failed.


```
kubectl.exe cp --kubeconfig .\kubconfig -n namespace-win pod-20240509-120334-779546rrfsc:C:\\data\\0509-1065.log 0509-1065.log
```

It showed

```
tar: Removing leading drive letter from member names
error: tar contents corrupted
```

### What did you expect to happen?

I want to copy the file to the localhost.

### How can we reproduce it (as minimally and precisely as possible)?

Windows 11 localhost
Windows Pod.


### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$(powershell) kubectl version
# paste output here

Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Unable to connect to the server: dial tcp 127.0.0.1:6443: connectex: No connection could be made because the target machine actively refused it.
```
</details>


### Cloud provider

<details>

</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

BuildNumber  Caption                      OSArchitecture  Version
22621        Microsoft Windows 11 Professional  64-bit          10.0.22621
```
</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>

--- end body ---
