31 Aug 2010
I've recently done a proof of concept using RabbitMQ, Spring AMQP and Spring Integration. This...
21 Jul 2010
In over ten years of experience building software, there are patterns and nuances that you...
13 Jul 2010
I set out to find an elegant solution to providing growl notifications for a JRuby...
05 May 2010
I've started playing around with Heroku lately and ran into an issue when I created...
30 Apr 2010
I've been meaning to investigate something that came to mind a while back and just...

Stupid Windows Tricks from the command line

Published: 13 Jun 2008

Change the Log on credentials for a windows service:

sc.exe config "YourServiceName" obj= "yourusername" password= "yourpassword"

Bring up services:

services.msc

Copy a directory structure:

xcopy G:\foo\*.* D:\bin\bar /E /D /Y

Copy a directory structure and exclude one or more files/directories:

xcopy \\nyceqasp8081\apps\polyent\*.* D:\apps\bar\ /E /D /Y /EXCLUDE:excludefile.txt

where excludefile.txt is a file containing one or more path exclusions for example D:\apps\bar\logs

Set environment variables:

setx JAVA_HOME "D:\bin\Java\jdk1.5.0_12" /m

The /m here denotes the variable should be a system wide variable. Leaving /m off will add the variable to the current user’s environment instead.

Map a drive and make it persistent (after reboots):

net use G: \\foo.bar.com\spg /P:Yes

Note: These have been tested and known to work on Windows Server 2003. Your mileage may vary on other variants of Windows.


blog comments powered by Disqus