Skip to main content

Posts

Showing posts from July, 2016

How to use System Restore to Remove Viruses

On Windows XP, Vista and Windows 7 machines, there is a feature called System Restore. It’s normally enabled by default and takes snapshots of your system files and registry settings. I have used it on several occasions to repair a machine that had a virus/malware infection. It can be very difficult to repair a virus or malware because as soon as the computer starts up, the virus gets loaded into memory and depending on the virus, it can prevent your attempts at removing it. Luckily the viruses that I saw were not too harmful. It’s only just annoying. You can try the following steps. First shutdown your computer. Turn on the computer again but start it up in Safe Mode. To get into safe mode, you need to press the F8 key so it can display a list of startup options. This can be tricky so I usually hit the F8 key as soon as the computer starts and just keep hitting it until the startup options come up. Select  Safe mode  from the list. Once you have started the computer in Safe mod

Powershell Script to Test if a Host is Up or Down

Description Sometimes it is necessary to do a ping test to find out if there are dropped packets. It is not practical to keep watch on the continuous ping test overnight. I wrote a little PowerShell script to make use of the Test-Connection cmdlet. It writes to a log file the change in network status. I didn't want it to record every ping responses. Basically it will record the date and time initially of the network status of a host. Then when there's a change in status, it will record the date and time and the state of the host i.e. UP or DOWN. From the logs, you can see if there had been dropped packets by looking at the change in status. The Code is below : ## Get current date and time $currentdate = get-date $count = 1 $myHost = "10.0.1.1" $maximumcount = 10 $networkstatus = 0    # 0 = up and 1 = down $outputfile = "C:\PowerShell\ pinglog.txt" # Do the initial ping test $currentdate = get-date $pingResponse = Test-Connec