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: 
> 
> But my computer is almost 10 years old and I have not had any data loss whatsoever. All my photos, videos and documents are there in their respective disks and all open and run smoothly.
> 
> 
> 

That's because "The contents of these sectors were moved to the spare area.". All modern disks have spare sectors for this purpose. However, there's a limited number of them, and when they run out, your harddisk can no longer do that.

On top, getting more and more bad sectors is an indicator that there is a problem somewhere in the disk (misalignment, a very slight mechanical problem, whatever). This tends to get worse exponentially, and what usually happens is one day everything is working fine, and the next day you turn on your harddisk it can hardly read anything at all.

So **now** is the time to buy a new harddisk, copy all your important files over, and start using the new harddisk instead of the old one for all your data.

You can still use the old one for things that can be easily replaced from somewhere else (e.g., applications downloaded from the Internet).
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.