Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, April 09, 2009

Worst Usability Example

To create a Windows service from the command line, one would normally use the sc command. I wasted almost half an hour today while settings Subversion's svnserve service. So I thought I had better document my ordeal.

To start with, sc has the worst command line syntax that I have seen in my entire life as a software developer. The syntax to create a service for Subversion, type:

sc create svn binPath= "c:\subversion\bin\svnserve.exe -r c:\repo" start= auto DisplayName= "Subversion Server" depend= Tcpip

Notice there is whitespace after the "=" character? No, it's not "start=auto". If you type that, sc will print out the command line syntax and the service is not created. Add in the space, you will have svnserve running as a Windows service.

Can someone explain why the syntax is so weird?

Wednesday, November 19, 2008

Getting uptime in Windows

In Linux environment, we can get the uptime of the workstation with the command uptime. But how do you find out how long your Windows has been running?

I found out recently that you can do this:
net stats server | find "Statistics since"


It doesn't tell you exactly how long your PC has been up and running, but it does tell you the time your Windows started.