skip to main content

Create WebLogic domain shortcut on desktop

I don't really remember why I have this script written, but seems fun. I wonder what my state of mind was at that time.

This script simply creates a desktop shortcut to the startweblogic.cmd program inside the specific weblogic domain.

$dn = "company_client_env"
$bea10_path = "C:\bea103\user_projects\domains"
$prog ="startweblogic.cmd"
$split_dn = $dn.split("_")
$client_name = $split_dn[1].toupper()
$instance_name = $split_dn[2].toupper()

$shortcut_name = $client_name,$instance_name
$shortcut_name = [string]::join(" ",$shortcut_name)

$shell = New-Object -ComObject WScript.Shell
$desktop = [System.Environment]::GetFolderPath('Desktop')
$shortcut = $shell.CreateShortcut("$desktop\$shortcut_name.lnk")
$shortcut.TargetPath = "$bea10_path\$dn\$prog"
$shortcut.IconLocation = "shell32.dll,137"

write-host "ICON Created for $($shortcut_name)"