Question: I'm trying to do a one-line batch command (for use with `autohotkey` with a keybaord shortcut) to:

* disconnect Wifi if it is connected: `netsh wlan disconnect`
* connect to SSID="MyWifi" if Wifi is currently disconnected: `netsh wlan connect ssid="MyWifi" name="MyWifi"`

This outputs some result if it is connected, and outputs nothing if it is disconnected:

```
netsh interface show interface |findstr /C:"Connected"

```

**How to use this in a `if else` condition?**

Example (pseudo code):

```
if ((netsh interface show interface |findstr /C:"Connected") == "")
then netsh wlan connect ssid="MyWifi" name="MyWifi"
else netsh wlan disconnect

```

Answer: 
Yes, it can. Increasing numbers of sectors failing means the drive is in early stages of failure. It doesn't mean it WILL fail tomorrow, but bad sectors piling up is a primary symptom of ongoing disk failure.
Can Bad sectors in Hard Drive really cause Data loss?

Yes, they can. It depends upon what worked and what did not. When it comes to Bad Sectors there are some related critical S.M.A.R.T. parameters.

**Reallocated Sector count** - Bad sectors that generally have been remapped to spare area.

**Current Pending Sector Count** - Unstable sectors on the hard disk that are yet to be remapped or reallocated. Sometimes these are SOFT errors and a full disk low-level reformat may correct it.

**Uncorrectable Sector Count** - Number of uncorrectable errors while reading or writing a sector on the hard drive. These may cause permanent data loss.

If the system completely fails to read a bad sector it may not at all reallocate it. In that case the entity e.g. a File that was residing there will get corrupted.

By chance you may be lucky or the issue is latent for now. One fine day you may open a photo and find that the file is actually corrupted.
I would be interested to see your full S.M.A.R.T. report. Showing these 3 critical parameters among all others.