Posts

Showing posts from March, 2012

Creating a SendTo Shortcut through MSI

If you want to create a SendTo shortcut through MSI, then if you just add the shortcut in MSI in SendTo folder, it will not work. Even if you get the shortcut there in every user profile, still it will not work. To make a SendTo shortcut, you need to create it on the fly, which means that shortcut should be created from original exe. To solve this issue for one of my application, WinSCP, I wrote the below VBScript and placed it in %ALLUSERPROFILE%\WinSCP folder. Then I created an Active setup to call this VBScript. Set Shell = CreateObject("WScript.Shell") ShortcutPath = Shell.SpecialFolders("SendTo") Set link = Shell.CreateShortcut(ShortcutPath & "\WinSCP (for upload).lnk") link.Arguments = "/upload" link.Description = "WinScp" link.HotKey = "" link.IconLocation = "C:\Program Files (x86)\WinSCP\WinSCP.exe,0" link.TargetPath = "C:\Program Files (x86)\WinSCP\WinSCP.exe" link.WindowStyle = 3 link.WorkingD...

VBScript to Kill a Process

This worked great for me. Just use as function and kill as many processes as you like. KillProc "abc.exe" Sub KillProc( myProcess )     Dim blnRunning, colProcesses, objProcess     blnRunning = False     Set colProcesses = GetObject( _                        "winmgmts:{impersonationLevel=impersonate}" _                        ).ExecQuery( "Select * From Win32_Process", , 48 )     For Each objProcess in colProcesses         If LCase( myProcess ) = LCase( objProcess.Name ) Then             ' Confirm that the process was actually running             blnRunning = True ...

VBScript to enable "Use this connection's DNS Suffix in DNS registration" in IPV4

I have written this below VBScript to enable "Use this connection's DNS Suffix in DNS registration" in IPV4 Advanced Settings. For Desktop adaptor, this (to enable "Use this connection's DNS Suffix in DNS registration" in IPV4) can be fixed by changing the registry value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\ NetworkInterfaceID \RegisterAdapterName to 1 Here NetowrkInterfaceID is a unique ID for every user and this can be obtained from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\8\ServiceName" key. The issue is there can be multiple Network adaptors connected to the machine like Network adaptor for Desktop, Wireless Adaptor, VMware adaptor etc and they all are stored under different hive, like 8, 12, 14 etc. Hence I have written a script which will check for all this and will change the value for all adaptors. If you want for only one particular adaptor, you can modify...