Archive for the ‘Software Development’ Category

Silent Install of JDK and JRE

Friday, June 13th, 2008

This week I had a requirement for scripting the installation of the Java 5 JDK and JRE. These instructions require separate install files for the JDK and JRE but will get the job done.

For the JDK, you can place the following in a *.bat file and simply run it from command line:

@echo off
echo Installing JDK…
start /w C:\temp\jdk-1_5_0_12-windows-i586-p.exe /s /v”/qn INSTALLDIR=d:\bin\Java\jdk1.5.0_12 REBOOT=Suppress”

For the JRE:

@echo off
echo Installing JRE…
start /w C:\temp\jre-1_5_0_12-windows-i586-p.exe /s INSTALLDIR=d:\bin\Java\jre1.5.0_12 REBOOT=Suppress

Some related links:

  1. http://java.sun.com/j2se/1.5.0/sdksilent.html
  2. http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/silent.html

Stupid Windows Tricks from the command line

Friday, June 13th, 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.


Fox Holes

  • You are currently browsing the archives for the Software Development category.

Rabbit Holes

Chasms