There are a few issues with your code. Here's the corrected version:
```batch
@echo off
if exist z:\ (
echo You have drive Z:
) else (
echo You don't have drive Z:
)
pause
```
The problem with your original code is that simply doing `z:` doesn't properly check if the drive exists in a reliable way. The `if exist` command is a better and more straightforward way to check if a drive or directory exists.
```batch
@echo off
if exist z:\ (
echo You have drive Z:
) else (
echo You don't have drive Z:
)
pause
```
The problem with your original code is that simply doing `z:` doesn't properly check if the drive exists in a reliable way. The `if exist` command is a better and more straightforward way to check if a drive or directory exists.

