“Watch” command in Windows

These days I needed to be able to check on the execution of a repetitive task. If I would use linux I could use the watch command but I am a Windows guy.

So I came up with an alternative – I created a bat file with the below content:

@ECHO OFF
:loop
  cls
  %*
  timeout /t 5
goto loop

To change the duration of the loop change the timeout /t 5 value (now it is 5 seconds).

Usage is similar to linux: watch dir *.jpg

Finding the WSUS server from which updates are downloaded

Open an administrative command prompt and type:

 Reg query „HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate” /s |findstr „WUServer”

The result is something like below:

WUServer REG_SZ http://wsusservername.domain.com
UseWUServer REG_DWORD 0x1

Done!

Setting the IP address in Windows recovery mode

I had to restore a server and when trying to get to the network to access the backup I had an error saying there was no IP address.

I tried running

name="Local Area Connection" static IPAddress subnet mask gateway

but I received an error: unknown connection.

To fix this we need to first run wpeinit from the command prompt and then run

name="Local Area Connection" static IPAddress subnet mask gateway