Sunday, November 23, 2008

Command in right-click

To enable Command when right-clicking on a file:

1. Create a new file with the extension (.reg).
2. Copy and paste the code below in it and save the file.

REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\Command] @="" [HKEY_CLASSES_ROOT\Directory\shell\Command\command] @="cmd.exe \\\"%1\\\""

3. Double-click the file, the message "Are you sure you want to add the information [path and name of the file] to registry?" will appear. Choose "Yes".

4. Complete!.

Wordpad in right-click

To enable wordpad when right-clicking on a file:

1. Create a new file with the extension (.reg).
2. Copy and paste the code below in it and save the file.

REGEDIT4
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\Wordpad]
[HKEY_CLASSES_ROOT\*\shell\Wordpad\command]@="Write %1"

3. Double-click the file, the message "Are you sure you want to add the information [path and name of the file] to registry?" will appear. Choose "Yes".

4. Complete!.

Notepad in right-click

To enable Notepad when right-clicking on a file:

1. Create a new file with the extension (.reg).
2. Copy and paste the code below in it and save the file.

REGEDIT4
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\Notepad]
[HKEY_CLASSES_ROOT\*\shell\Notepad\command]@="Notepad %1"

3. Double-click the file, the message "Are you sure you want to add the information [path and name of the file] to registry?" will appear. Choose "Yes".

4. Compelete!.

In/Uninstall dll/activex using right-click

To in/uninstall dlls/activex by right-clicking on the file, do the following:

1. Create a new file with the extension (.reg).
2. Copy and paste the code below in the file and save it.

REGEDIT4
; ActiveX DLLs
[HKEY_CLASSES_ROOT\.dll]@="dllfile"
[HKEY_CLASSES_ROOT\dllfile\shell\regdll]@="Register ActiveX DLL"
[HKEY_CLASSES_ROOT\dllfile\shell\regdll\command]@="regsvr32.exe \"%L\""
[HKEY_CLASSES_ROOT\dllfile\shell\unregdll]@="Unregister ActiveX DLL"
[HKEY_CLASSES_ROOT\dllfile\shell\unregdll\command]@="regsvr32.exe /u \"%L\""
; ActiveX Controls
[HKEY_CLASSES_ROOT\.ocx]@="ocxfile"
[HKEY_CLASSES_ROOT\ocxfile\shell\regocx]@="Register OCX Control"
[HKEY_CLASSES_ROOT\ocxfile\shell\regocx\command]@="regsvr32.exe \"%L\""
[HKEY_CLASSES_ROOT\ocxfile\shell\unregocx]@="Unregister OCX Control"
[HKEY_CLASSES_ROOT\ocxfile\shell\unregocx\command]@="regsvr32.exe /u \"%L\""
; ActiveX EXEs
[HKEY_CLASSES_ROOT\.exe]@="exefile"
[HKEY_CLASSES_ROOT\exefile\shell\regexe]@="Register ActiveX EXE"
[HKEY_CLASSES_ROOT\exefile\shell\regexe\command]@="\"%L\" /regserver"
[HKEY_CLASSES_ROOT\exefile\shell\unregexe]@="Unregister Active EXE"
[HKEY_CLASSES_ROOT\exefile\shell\unregexe\command]@="\"%L\" /unregserver"

3. Double-click on the file and the message "Are you sure you want to add the information in [path and name of the file you created] to the registry?". Choose "Yes".

4. Complete!.

Tuesday, November 18, 2008

[How To] Backup Exchange 2007 on Windows 2008 Server locally with ntbackup

Windows Server Backup in Windows Server 2008 does not support Exchange backup unless you are using smal business server which supoort exchange backup. So to backup exchange on windows 2008 server we need to copy ntbackup files from Windows 2003 server x64.

1. Create a new folder on the 2008 server machine root. Then copy the three files (ntbackup.exe, ntmsapi.dll and vssapi.dll) from 2003 server to the folder created on the 2008 server.

2. Make sure you have "Removable Storage Manager" feature is installed on 2008 server as shown belo:


3. Start ntbackup.exe.

[How To] Install Microsoft Java VM

The following steps to install Microsoft Java VM:

1. Download and install on Java VM based on your Windows:

More links:

www.java-virtual-machine.net
www.alibre.com/support/downloads

To manually uninstall Microsoft Java VM click here

[How To] Manually Uninstall Microsoft Java VM

The following Steps for Manual removal of Microsoft Java Virtual Machine.

1. Go to Start -> Run and paste the following command into the run box:

RunDll32 advpack.dll,LaunchINFSection java.inf,UnInstall

If you are running an older version of the JVM you may need to upgrade to version 3809 or 3810 (windows update) before the above command will work.

You will then be asked if you really want to remove the virtual machine and then reboot. At this point if a message is displayed to the effect of 'removing the jvm will prevent you being able to download files' this refers to files downloaded through java applets rather than regular file downloads.

2. Remove the following registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\JAVA_VM (Key used for VM entry in IE Advanced Options)

3. Remove the following System Folder and files:

C:\WINDOWS\System32\jview.exe
C:\WINDOWS\System32\wjview.exe
C:\WINDOWS\inf\java.pnf
C:\WINDOWS\java
(C:\Windows represents the drive and path of your windows install, %windir%)

To reinstall Micrsoft Java VM click here

Thursday, October 9, 2008

Read/write file text

The following functions is for reading/writing the entire file content.

Imports system.io

Public Shared Function ReadTextFromFile(ByVal FullPath As String, _
Optional ByRef ErrInfo As String = "") As String

Dim strContents As String
Dim objReader As StreamReader
Try
objReader = New StreamReader(FullPath)
strContents = objReader.ReadToEnd()
objReader.Close()
Return strContents
Catch Ex As Exception
ErrInfo = Ex.Message
End Try
End Function

Public Shared Function SaveTextToFile(ByVal strData As String, _
ByVal FullPath As String, Optional ByVal ErrInfo As String = "") As Boolean

Dim Contents As String
Dim bAns As Boolean = False
Dim objReader As StreamWriter
Try
objReader = New StreamWriter(FullPath)
objReader.Write(strData)
objReader.Close()
bAns = True
Catch Ex As Exception
ErrInfo = Ex.Message
End Try
Return bAns
End Function

Saturday, October 4, 2008

[How To] Installing CDO for windows 2003

Microsoft Windows 2003 does not have Collaboration Data Objects (CDO) for NTS (CDONTS) nor for Exchange 2000 (CDOEX) installed. Therefore, applications that uses CDONT or CDOEX will not function. To install them use the steps below:

1. Download cdo.zip file. Then extract both (or only one as needed) to %systemroot%\system32.

2. Register the files using the commands below:

regsvr32 "%systemroot%\system32\cdonts.dll"

regsvr32 "%systemroot%\system32\cdoex.dll

3. If you have SMTP server then goto step 8, otherwise continue to step 4 to install and setup local SMTP service.

4. Check to see if SMTP services is installed by going to Administrative Tools, IIS and expand local machine, if SMTP service is listen then its installed otherwise continue to step 5 for installing SMTP service.

5. To install SMTP perform the following operation: Go to Control Panel, Add/Remove Programs, Add/Remove Windows Components, Application Server, IIS, Check on SMTP service, Click OK.

6. Change the port number for SMTP service. Default port is 25. Use 25 only if you don't have another SMTP service running. If another SMTP service is already running on your server you should switch IIS SMTP port to another, for example to 8025.

You can do through IIS management console: Control Panel, IIS, expand "local computer", SMTP, Properties, General tab, click on Advanced button, Edit.

7. Configure SMTP service. The main things are to set a valid full-qualified domain name for SMTP service: Control Panel, IIS, expand "local computer", SMTP, Properties, Delivery tab, click on Advanced button and configure Security for SMTP service.

It's necessary to grant permissions to IIS_WPG standard IIS Worker Process Group. Control Panel, IIS , expand "local computer", SMTP, Properties, Security tab , click on Add button, click Object types... button, check on Groups item, click OK, type IIS_WPG as object name to add , click OK.

Additional setting: Choose Authentication and tick Anonymous Access and Integrated Windows Authentication. Click OK, and then click CONNECTION. Configure RELAY settings as you wish. Click the DELIVERY tab then click ADVANCED. Set the MAX hop count to whatever you like but we recommend at least 30

Now IIS SMTP service is configured and ready to work.

8. Now to test the CDO component & the SMTP Service, use the following code:

Dim objCDO, objCDOConfig, objFields

Set objCDO = CreateObject("CDO.Message.1")
Set objCDOConfig = CreateObject("CDO.Configuration")
Set objFields = objCDOConfig.Fields

With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "[Your SMTP SERVER" ' localhost if you are using your local SMTP service
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/SendUsing") = 2

' If your SMTP Service require authentication that you need to set authentication,username, and password.
' otherwise, just remark the these rows
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 2 ' cdoBasic
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[UserName]"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "[Password]"
.Update
End With

With objCDO
.Configuration = objCDOConfig
.To = """FirstName LastName"" <[Emailadress]>"
.BCC = """FirstName LastName"" <[Emailadress]>"
.From = """FirstName LastName"" <[Emailadress]>"
.Subject = "[Subject]"
.TextBody = "[Body]"
.HTMLBody = "[Body]"
.AutoGenerateTextBody = False
.Send
End With
set objCDo = Nothing