Pages

Monday 29 August 2011

Get ComputerName + VBScript

Set oNetwork = CreateObject("WScript.Network")
sComputerName = oNetwork.ComputerName
MsgBox("ComputerName = " & sComputername)

Active Setup Registry Keys

Following Registries are to be included in package to load User settings(either registries/files) so that by the time User
logs in his current user settings will be available on the machine.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode]]
"StubPath"="msiexec /fup {9A346205-EA92-4406-B1AB-50379DA3F057} /qn"
"Version"="1,0"

Set Working Directory to Shortcut Using VBScript

Set objShell = WScript.CreateObject("WScript.Shell")
Set objShtCut = objShell.Createshortcut("C:\Documents and Settings\All Users\Start Menu\Programs\ShortcutName.lnk")
objShtCut.WorkingDirectory = "C:\PROGRA~1\MKSTOO~1\Demonstrations\bin"
objShtCut.Save
'WScript.Echo objShtCut.WorkingDirectory

VBScript to Terminate Process

Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill 
strProcessKill = "'ProcessName.exe'" 
Set objWMIService = GetObject("winmgmts:root\cimv2") 
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next 
WScript.Quit

Ger CurrentDirectory using VBScript

on Error Resume Next

	Set objWshShell = CreateObject("WScript.Shell")
	Set objFileSystem = CreateObject("Scripting.FileSystemObject")

	sScriptDir=objFileSystem.GetParentFolderName(WScript.ScriptFullName)

msgbox sscriptdir

Installshield 2012 Released

Installshield 2012 is the latest version best installation development solution which can be downloaded from flexera Software website

MsiLockPermissionsEx table



MsiLockPermissionsEx Table in Windows 7 enhances the functionality over LockPermissions Table. With MsiLockPermissionsEx table, users now have the ability to set access permissions on objects impacted by the application install that previously required using custom actions or other methods outside of Windows Installer


Expanding the set of permissions that can be applied to a resource by incorporating the Security Descriptor Definition Language(SDDL) in Windows Installer. This allows the security settings for an object to be more flexible, including;


o Ability to apply Deny ACLs to objects
o Indicate inheritance properties for permissions
o Expand the set of well-known SIDs
o Ability to set Owner, Group, and SACLs to the objects in addition to the regular access permissions


Security settings can be applied to services as well in addition to Files, Folders, Registry keys


Ability to apply permissions specific to user accounts – including accounts that are newly created on the system during the course of installation
Read more about this in Windows installer team blog