yesJames.com
ahuh… sure… what ever you say…


How to find Windows uptime

Posted in Software by james on January 13th, 2009

Ok, so you want to know how long it’s been since your windows workstation or server was last (re)booted. There are two options. The first is built right into windows, the second is an external command-line program provided by Microsoft to help with the problem.

Option 1:

  1. Go to “Start” -> “Run“.
  2. Write “cmd” and press on “Enter” key.
  3. Write the command “net statistics server” and press on “Enter” key.
  4. The line that start with “Statistics since …” provides the time that the server was up from.

* The command “net stats srv” can be use instead.

Option 2:

The Uptime.exe tool allows you to estimate Server Availability with Windows NT 4.0 SP4 or Higher.

Uptime.exe is a standalone program. To install the tool, simply copy the file into your Windows directory. You may then run the tool at a command prompt.

For extended help on this tool, type the following at a command prompt:

uptime /help

This tool is most accurate when run with administrator privileges, however, even without administrator privileges, the tool attempts to make a best estimate based on available information. In all cases, the results should be considered estimates.

The uptime.exe program can be downloaded from Microsoft here:
http://download.microsoft.com/download/winntsrv40/install/uptime_1.01/nt4/en-us/uptime.exe

See also:

http://support.microsoft.com/kb/555737
http://support.microsoft.com/kb/232243

Enabling Remote Desktop access… remotely

Posted in Software by james on November 19th, 2008

Firstly you can edit the Registry of the remote machine by hand:

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server on the remote machine, and find the key: fDenyTSConnections
If it doesn’t exist create it, then set it’s value to “0″.

Alternatively you can use the following batch file to do the job for you.
Note: You must be logged into your computer with credentials that allow you to remotely edit the Registry of the machine in question, otherwise the batch file will fail.

syntax: EnableRemoteDesktop.bat RemotePC
NB: This batch file must be run under Windows XP

Save the following to a file named EnableRemoteDesktop.bat

@echo off
setlocal
if {%1}=={} goto syntax

:loop
if {%1}=={} goto finish
set remote="\\%1\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server"
shift
reg.exe ADD %remote% /v fDenyTSConnections /t REG_DWORD /d 0 /f>nul 2>&1
if NOT %ERRORLEVEL% EQU 0 @echo %remote% NOT found.
goto loop

:syntax
@echo Syntax: RemoteDesktop Computer1 [Computer2 .... Computern]
goto loop

:finish
endlocal