Host Africa

Thursday 24 April 2014

XP Error on Boot

(WIndows could not start because the following file is missing or corrupt:
\WINDOWS\SYSTEM32\CONFIG\SYSTEM)

Boot with Hirens CD Mini XP

Go to C:\Windows\system32\config and rename system to system.bak
Copy system from C:\windows\repair to C:\windows\system32\config
Reboot pc and it should work normally.

This can be done via the repair console as well
1/ Insert the Windows XP CD into the CD-ROM and restart your pc.

2/ At the ‘Welcome to Setup’ screen press R to start the recovery Console.

3/ The Recovery Console will now open and the list of Windows installations will

appear.

4/ As you only have one installation on your PC you need to press the number which is

relevant to your installations location. This, obviously will typically be 1 (one).

5/ When requested type in your Administrator password. If you haven’t set an

administrator password, then simply press Enter.

6/ The Recovery Console command prompt window will now appear.

7/ At the Command prompt type the following, pressing Enter after you have typed each

line. It is assumed that your root directory will be C: However, if your root

directory isn't C:, for example, if you have other partitions/drives on your system

you may have installed XP to say the D: drive, the you will need to substitute each

reference to C: with the letter of your root directory.

    * md tmp
    * copy c:\windows\system32\config\system
    * c:\windows\tmp\system.bak
    * copy c:\windows\system32\config\software
    * c:\windows\tmp\software.bak
    * copy c:\windows\system32\config\sam
    * c:\windows\tmp\sam.bak
    * copy c:\windows\system32\config\security
    * c:\windows\tmp\security.bak
    * copy c:\windows\system32\config\default
    * c:\windows\tmp\default.bak



    * delete c:\windows\system32\config\system
    * delete c:\windows\system32\config\software
    * delete c:\windows\system32\config\sam
    * delete c:\windows\system32\config\security
    * delete c:\windows\system32\config\default



    * copy c:\windows\repair\system c:\windows\system32\config\system
    * copy c:\windows\repair\software c:\windows\system32\config\software
    * copy c:\windows\repair\sam c:\windows\system32\config\sam
    * copy c:\windows\repair\security c:\windows\system32\config\security
    * copy c:\windows\repair\default c:\windows\system32\config\default

8/ Now type Exit to exit the recovery console.



\


Tuesday 22 April 2014

VBS Script to clean all users profile (XP - Win8)

'
' Clean All Temp Etc.
'
' version 3.75
'
' by Jonathan Brickman, a substantial rewrite and
' enhancement of a core originally written by David Barrett
'
' last mod 2014-02-17
' Added clearing of profile WER data
' Added clearing of profile localappdata temp folders
' Fixed a few visual buglets
' Added clearing of Windows Error Reporting queue
' Added explicit search for system profiles
' Added clearing of Google Chrome cache
' Improved type setting for free space reports
' Added report as to how much space freed
' Added usability as SYSTEM user under Windows 7 et al.
' Added item ticks (comma for files, slash for subfolders)
'
' Core originally written by David Barrett
' Copyright 2009
' http://www.cedit.biz/
' This script is licensed under the Creative Commons
' Attribution 2.5 Licence
' http://creativecommons.org/licenses/by/2.5/
'
' You are free to use it for both personal and
' commercial purposes, so long as full attribution
' is given to the author (David Barrett).
'
' This notice must not be removed
'
' Substantially Enhanced by Jonathan E. Brickman
'
'

force_cscript

dim objWSH, objFSO, sysDrv
dim initialFreeSpace
dim strComputer
dim objRegistry
dim strKeyPath, objSubKey, arrSubkeys, strValueName
dim sProfile
dim sTemp, sTmp, sWindows, sLocalAppData, sProgramData, sWER, sDotNetItem

wscript.echo "CleanAllTemp"
wscript.echo ""
wscript.echo "originally by David Barrett"
wscript.echo "updated and modded substantially by Jonathan E. Brickman"
wscript.echo ""
wscript.echo "Cleans all profiles' temp and IE cache folders"
wscript.echo "A whole subfolder deletion is indicated by \"
wscript.echo "A file deletion is indicated by ,"
wscript.echo ""

set objFSO = CreateObject("Scripting.FileSystemObject")
set objWSH = CreateObject("WScript.Shell")
set sysDrv = objFSO.GetDrive(objFSO.GetDriveName(objWSH.ExpandEnvironmentStrings("%SystemDrive%")))

sTemp = objWSH.ExpandEnvironmentStrings("%TEMP%")
sTmp = objWSH.ExpandEnvironmentStrings("%TMP%")
sWindows = objWSH.ExpandEnvironmentStrings("%SystemRoot%")
sLocalAppData = objWSH.ExpandEnvironmentStrings("%LOCALAPPDATA%")
sProgramData = objWSH.ExpandEnvironmentStrings("%ProgramData%")
If sProgramData <> "" Then
sWER = objWSH.ExpandEnvironmentStrings("%ProgramData%") & "\Microsoft\Windows\WER\ReportQueue"
Else
sWER = ""
End If

' Get current free space on system drive
initialFreeSpace = CDbl(sysDrv.FreeSpace)

Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set objRegistry=GetObject("winmgmts:\\" & _
    strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys

For Each objSubkey In arrSubkeys

strValueName = "ProfileImagePath"
strSubPath = strKeyPath & "\" & objSubkey
objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE,strSubPath,strValueName,sProfile

wscript.echo "Cleaning profile folder: " & sProfile

DeleteFolderContents sProfile & "\Local Settings\Temp"

DeleteFolderContents sProfile & "\Local Settings\Temporary Internet Files\Content.IE5"

DeleteFolderContents sProfile & "\Local Settings\Temporary Internet Files"

DeleteFolderContents sProfile & "\AppData\Local\Google\Chrome\User Data\Default\Cache"

DeleteFolderContents sProfile & "\AppData\Local\TEMP"

DeleteFolderContents sProfile & "Application Data\Local\Microsoft\Windows\WER"

Next

' Now empty the windows\temp folder if not the same
wscript.echo "Processing folder: " & sWindows & "\Temp"
DeleteFolderContents sWindows & "\Temp"

' And ditto the system-wide Windows Error Reporting queue, if it exists.
If sWER <> "" Then
wscript.echo "Processing folder: " & sWER
DeleteFolderContents sWER
End If

wscript.Echo ""
WScript.echo "Freed " & CLng( CDbl(CDbl(sysDrv.FreeSpace) - CDbl(initialFreeSpace))/CDbl(1024*1024)) & " megabytes."

Set sysDrv = Nothing
Set objWsH = Nothing
Set objFSO = Nothing
Set objRegistry = Nothing

' ---------------------- Subroutines -------------------

sub DeleteFolderContents(strFolder)
    ' Deletes all files and folders within the given folder
    dim objFolder, objFile, objSubFolder, itemCount
    on error resume next

    itemCount = 0
    set objFolder=objFSO.GetFolder(strFolder)

    if Err.Number<>0 then
        Err.Clear
        Exit sub ' Couldn't get a handle to the folder, so can't do anything
    end if
    for each objSubFolder in objFolder.SubFolders
        objSubFolder.Delete true
        if Err.Number<>0 then
            'Try recursive delete (ensures better result)
            Err.Clear
            DeleteFolderContents(strFolder & "\" & objSubFolder.Name)
else
   wscript.stdout.write "\"
   itemCount = itemCount + 1
        end if
    next
    for each objFile in ObjFolder.Files
        objFile.Delete true
        if Err.Number<>0 then
Err.Clear ' In case we couldn't delete a file
else
wscript.stdout.write ","
       itemCount = itemCount + 1
end if
    next

    Set objFolder = Nothing

    if itemCount > 0 then
wscript.stdout.write vbCRLF
    end if
end sub

sub force_cscript
    dim args : args=""
    dim i, wshshell
    If right(lCase(wscript.fullname),11)= "wscript.exe" then
        for i=0 to wscript.arguments.count-1
            args = args & wscript.arguments(i) & " "
        next

        Set WshShell = CreateObject("wscript.shell")

        wshshell.run wshshell.ExpandEnvironmentStrings("%comspec%") & _
            " /c cscript.exe //nologo """ & wscript.scriptfullname & """" & args

        set wshshell=nothing

        wscript.quit
    end if
end sub

Friday 4 April 2014

Exchange 2007 and 2010 error
(The name on the security certificate is invalid or does not match the name of the site)







  1. Do not use a self signed certificate
  2. Get one from a Certificate authority like Godaddy and make sure
  3. to add autodiscover.yourdomain.com, mail.yourdomaim.com (The dns name you use externally) or you can add a wild card like *.yourdomain.com
Now you can use Exchange management console to assign the certificate






Cut and paste the following and replace the EXCHANGESERVER for the name of your Exchange Server and the Domain for your domain.
Set-ClientAccessServer -Identity EXCHANGESERVER -AutoDiscoverServiceInternalUri https://mail.yourdomain.com/Autodiscover/Autodiscover.xml
Set-WebServicesVirtualDirectory -Identity “EXCHANGESERVER\EWS (Default Web Site)” -InternalURL https://mail.yourdomain.com/EWS/Exchange.asmx -BasicAuthentication:$true
Set-OABVirtualDirectory -Identity “EXCHANGESERVER\OAB (Default Web Site)” -InternalURL https://mail.yourdomain.com/OAB


Set-ActiveSyncVirtualDirectory -Identity “EXCHANGESERVER\Microsoft-Server-ActiveSync (Default Web Site)” -ExternalURL https://mail.yourdomain.com/Microsoft-Server-Activesync

Onl do this if you are using OutlookAnyware
Enable-OutlookAnywhere -Server EXCHANGESERVER -ExternalHostname “mail.yourdomain.com” -ClientAuthenticationMethod “Basic”-SSLOffloading:$False


Thursday 3 April 2014

Mapped Drives missing in Pastel 12 with Windows 8


1) "Disable" UAC by going into User Account Control settings and dragging the slider to the bottom. (I'm aware this doesn't completely disable UAC. Completely disabling UAC in the registry kills the App ecosystem, which is something I'm hoping to avoid)
2) Enable Linked Connections by creating a DWORD named EnableLinkedConnections with a value of 1 in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
3) Reboot the computer.

Wednesday 2 April 2014

Installing Access 97 on Windows 7 or Windows 8
("There is no license" error message starting Microsoft Access)


  1. Quit all Microsoft Office programs that may be running on your computer.
  2. On the Start menu, point to Find, and then click Files or Folders.
  3. In the Named box, type hatten.ttf.
  4. In the Look in box, type c:\windows\fonts.

    Note
    The path to the Fonts folder may be different on your computer.
  5. Click Find Now to start the search.

    Note If Hatten.ttf is not found, try searching for Haettenschweiler.ttf. Haettenschweiler is the full name of the Hatten font.
  6. Under Name, right-click the hatten.ttf file, and then click Rename on the shortcut menu that appears.
  7. Change the name of the file to hatten.xxx. If you receive a prompt that states that changing the extension may cause the file to become unusable, click Yes.
  8. Minimize, but do not close, the Find dialog box.
  9. On the Start Menu, point to Settings, and then click Control Panel.
  10. In Control Panel, double-click Add/Remove Programs.
  11. In the Add/Remove Program Properties dialog box, click the Install/Uninstall tab, and select Microsoft Office 97, Professional Edition in the program list.
  12. Click Add/Remove to run Office Setup in Maintenance Mode.
  13. In the Microsoft Office 97 Setup dialog box, click Reinstall.
  14. After the reinstallation is finished, click the Find dialog box on the taskbar to maximize it.
  15. Under Name, right-click the hatten.xxx file, and then click Rename on the shortcut menu that appears.
  16. Change the name of the file back to hatten.ttf.
Introduction and Welcome!
Hello Friends and Colleagues!

I have started this blog...well...for me to make work life easier!