CJSmith dot me

I dump stuff I find useful here

Author: Chris Smith

Make mailto links open IBM Notes 8 Basic Configuration instead of Standard

Published / by Chris Smith / Leave a Comment

Note: I can’t find who to credit with this, I believe it was the IBM Notes forum but I never took a URL.
When IBM Notes 8 is installed mailto links will still launch the Standard Client. For machines which you want to launch the Standard Client the registry needs to be amended
Open the registry editor.
Navigate to [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Lotus Notes\Protocols\mailto\shell\open\command]
The (Default) value is C:\\Program Files\\IBM\\Lotus\\Notes\\notes.exe -defini %1 for 32 Bit Machines and C:\\Program Files (x86)\\IBM\\Lotus\\Notes\\notes.exe -defini %1 for 64 bit machines
Right-click (Default) and choose “Modify”
After notes.exe add ” -sa” (-sa makes notes.exe launch in the Basic Configuration client) so it looks like C:\\Program Files (x86)\\IBM\\Lotus\\Notes\\notes.exe -sa -defini %1

This can of course be done via a registry file (The registry file will remove the default key and then recreate it, but as with any registry file it should be tested first)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Lotus Notes\Protocols\mailto\shell\open\command]
@=-
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Lotus Notes\Protocols\mailto\shell\open\command]
@="\"C:\\PROGRA~2\\IBM\\Lotus\\Notes\\notes.exe\ -sa -defini %1\""

A further method can be done as described on (This link has stopped working before June 2017)
A further method from 8.0.2 in notes.ini is described on http://www.ns-tech.com/blog/geldred.nsf/plinks/geld-7shkqy and I would recommend this method if you change the notes.ini file on affected machines.

IBM Domino 8.0 nsf upgrade failures causing corruption on Lotus Notes Database Views

Published / by Chris Smith / Leave a Comment

I had an issue where corruption on local Lotus Notes Database views resulted in views such as the Inbox showing [Replication or Save Conflict] instead of actual emails.  For me this occurred during migrating nsf files to the latest version (Version 6.x to Version 8.x) on Lotus Domino (Domino was already version 8.0.1 however we wanted to take advantage of new Domino features such as improved compression). It appears some users local databases obviously were using old versions of the nsf file.

The first thing to do is refresh the affected views, open IBM Notes and get a view showing “[Replication or Save Conflict]”, press Shift + F9
Close the IBM Notes client and delete the Cache file in the Notes data directory (cache.ndk).
Reload IBM Notes and see if this has resolved the issue, if not on the Domino Server run “load updall -R mail\username.nsf”

As a last resort on the client rename cache.ndk desktop6/8.ndk’s in the users data directory (Obviously renaming the desktops may affect older IBM Notes apps!)

Unable to turn off Out of Office when it was set in Lotus Domino Web Access 8.0

Published / by Chris Smith / Leave a Comment

If a user finds they are unable to turn off their Out of Office Alert after setting it on Domino Web Access in version 8.0 the below fix from IBM Notes Forum can correct the affected Agents behaviour.

1. Run “tell amgr sched” on all the servers in the Domain in order to verify in what database (mail\.nsf) is running the Out Of Office agent.
2. Open the database with the problem (mail\.nsf) from the Domino Administrator.
3. Go to –> View –> Design. At this point the Lotus Domino Designer will be opened with the database selected.
4. Expand the Code section from the left side menu and double click in Agents.
5. Select the OutOfOffice agent from the list.
6. Click in Disable button and close.
7. Verify again the Out Of Office agent from the server console executing: “tell amgr sched”.
At this point, the Out Of Office for this specific client will be disabled.

Edit: The forum link no longer works and therefore has been unlinked –

SNMP Agent in Lotus Domino Server for Windows Server

Published / by Chris Smith / Leave a Comment

To setup the Domino 8.0.x SNMP Agent (If not included as a feature when installing Lotus Domino) first ensure Windows snmp service is installed and stopped. Dominos SNMP utilises event4.nsf and therefore can be customised as required.

We can instruct the Domino Server to install a service on Windows by running the following in a Domino console window
lnsnmp -Sc
As long as Domino is running with admin right a new service should appear and Domino should configure it to run automatically. Instead of restarting the server you can start both services from a Windows Command Prompt window running with administrative privileges.
net start snmp
net start lnsnmp

SNMP Tools (Requires loading Dominos MIB file which should be in the Domino’s executable folder) should now be able to query the status of the Lotus Domino Server.

Compress and move existing Windows 2012 and Microsoft SQL Server 2008 Express backups

Published / by Chris Smith / Leave a Comment

The following has been used to backup a server with Cisco Cubac on. The software runs on Windows 2012 machine and uses SQL Server 2008 Express.
As its not on a managed server I had to find a way to backup the server and the database, plus keep the backup as small as possible.
I get the Windows backup tool to backup once a day and save it to D:\WindowsImageBackup\, I then get the script below to run which then backs up SQL Server 2008 Express separately. I then get the backups compressed with 7zip and move them to a network storage device.
The destination NAS required a username and password, I had to put in a username and password (Not recommended although I believe SAMBA may not have been configured correctly).
If the server was on the same domain as the backup destination then get rid of “/user:username Password” from the net use line, normally having an account with the same username and password should work.

This batch requires RoboCopy (I believe is installed with the OS), 7Zip, a destination device and lots of disc space to fit the backups.

This has been used on a server with Windows 2012 and Microsoft SQL Server 2008 Express to backup a Cisco Cubac install.
The script will call SqlBackup.sql to tell SQL to backup the databases (As it installed with SQL Server 2008 Express).
Everything surrounded by <> needs to be changed, anything calling a directory needs to be checked.
%hostname% is not used for ServerHostName variable, its used for the SQL instance name (Which normally is the hostname).

echo Script runs a manual backup of SQL before moving it to the NAS.
echo Additional files such as backups by Windows are also copied across, but these must be generated by Windows Server Backup.
echo Setting up Variables
Set FileDate=%date:~-10,2%%date:~-7,2%%date:~-4,4%
rem change to SQL instance name
Set ServerHostName=
rem change backup destination
Set NasPath=\\BackupDestination\Cisco_Cubac\
Set Nasoldfiles=%NasPath%\OldFiles\
rem Set where the script runs from
Set BackupScript=C:\Wherethescriptrunsfrom\
Set Sqllocal=
rem Change username and password as required
net use %NasPath% /user:username Password /persistent:no > %BackupScript%logs\%filedate%-MapDrive.log
c:
mkdir %BackupScript%logs
mkdir %BackupScript%7ztemp
echo Run SQL Backup and put output into log file and append with date %FileDate%
sqlcmd -S %ServerHostName% -i %BackupScript%SqlBackup.sql > %BackupScript%logs\%filedate%-SqlBackup.log
echo Compress and move the latest SQL backup to the NAS
"C:\Program Files\7-Zip\7z.exe" a -t7z %BackupScript%7ztemp\%filedate%-FileSystem.7z %Sqllocal%*.bak > %BackupScript%logs\%filedate%-SqlBackupCompress.log
Robocopy %BackupScript%7ztemp\ %NasPath%Sqlbackup *.7z /E /MOVE /V /R:3 /W:5 > %BackupScript%logs\%filedate%-MoveSQLBackup.log
del %Sqllocal%*.* /Q > %BackupScript%logs\%filedate%-DeleteSQLBackup.log
echo Compress and move Windows backup from drive to NAS and remove old files
d:
mkdir D:\7ztemp
rem Change "D:\WindowsImageBackup\" to where the Windows backup is located
"C:\Program Files\7-Zip\7z.exe" a -t7z D:\7ztemp\%filedate%-ServerBackup.7z "D:\WindowsImageBackup\" > %BackupScript%logs\%filedate%-WinBackupCompress.log
Robocopy D:\7ztemp %NasPath%Winbackup\%filedate%\ *.* /E /MOVE /V /R:3 /W:5 > %BackupScript%logs\%filedate%-MoveWinBackup.log
rmdir "D:\WindowsImageBackup\" /S /Q >> %BackupScript%logs\%filedate%-DeleteWinBackup.log
mkdir "D:\WindowsImageBackup\" >> %BackupScript%logs\%filedate%-DeleteWinBackup.log
echo Remove old Files on NAS by using Robocopy to copy files over a certain age into a specific folder
mkdir %Nasoldfiles%
ROBOCOPY %NasPath%Sqlbackup %Nasoldfiles% /move /minage:7 >> %BackupScript%logs\%filedate%-NasRemoveOldFiles.log
ROBOCOPY %NasPath%Winbackup %Nasoldfiles% /E /move /minage:7 >> %BackupScript%logs\%filedate%-NasRemoveOldFiles.log
ROBOCOPY %NasPath%Backuplogs %Nasoldfiles% /move /minage:7 >> %BackupScript%logs\%filedate%-NasRemoveOldFiles.log
del %Nasoldfiles%*.* /Q > %BackupScript%logs\%filedate%-NasDeleteOldFiles.log
echo Move Backupscript logs to NAS to complete job
Robocopy %BackupScript%logs\ %NasPath%Backuplogs\ *.* /E /MOVE /V /R:3 /W:5

This second file (SQL Backup File for Microsoft SQL Server 2008 Express) is called separately, above I have called it SqlBackup.sql in the folder specified in variable BackupScript.

BACKUP DATABASE [ATTCFG] TO  [FileSystem] WITH NOFORMAT, NOINIT,  NAME = N'ATTCFG-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
BACKUP DATABASE [ATTLOG] TO  [FileSystem] WITH NOFORMAT, NOINIT,  NAME = N'ATTLOG-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
BACKUP DATABASE [master] TO  [FileSystem] WITH NOFORMAT, NOINIT,  NAME = N'master-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
BACKUP DATABASE [model] TO  [FileSystem] WITH NOFORMAT, NOINIT,  NAME = N'model-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
BACKUP DATABASE [msdb] TO  [FileSystem] WITH NOFORMAT, NOINIT,  NAME = N'msdb-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

Synctoy 2.1 setup batch script

Published / by Chris Smith / Leave a Comment

This code was used to speed up the setup of SyncToy 2.1 (I see no reason to backup the entire user profile folder, but I hate having to setup multiple sync jobs). As Microsoft has not updated SyncToy it may not work on anything other than Windows 7.
The script expects SyncToy 2.1 is installed and that the destination is always the H drive (For whatever reason I am not using a variable for the main location, I may update this at some point as code to select another path is already in).

rem Batch Script to setup Synctoy 2.1.  Tested on Windows 7 for standard Users.
rem Additional Credits https://groups.google.com/forum/#!topic/alt.msdos.batch.nt/kOsN-QIOYEY for on the fly generation of VBS code
rem Amended 2/4/2014 to use Contribute instead of Synchronise to prevent unexpected deletions for users being moved servers with an out of date backup.
 
                REM Check Windows Version is 7
                                ver | findstr /i "6\.1\." > nul
                                IF %ERRORLEVEL% EQU 0 goto sub_begincheck
                                                goto sub_wrongos
:sub_begincheck
                rem Show Home Drive for troubleshooting purposes
                                rem set homedrive
                rem show profile directory for troubleshooting purposes
                                rem set userprofile
                rem If Homedrive is H begin copy
                                if "%homedrive%"=="H:" then
                                                Set backupdir=%homedrive%
                                                                goto :sub_synctoysetup
                                                Else
                rem If Homedrive is not H: ask for new filepath
                                goto :BrowseFolder
:sub_synctoysetup
                rem Create Directories on H:
                                mkdir "H:\LaptopBackup\"
                                mkdir "H:\LaptopBackup\Desktop"
                                mkdir "H:\LaptopBackup\Favorites"
                                mkdir "H:\LaptopBackup\Documents"
                                mkdir "H:\LaptopBackup\Downloads"
                                mkdir "H:\LaptopBackup\Music"
                                mkdir "H:\LaptopBackup\Pictures"
                                mkdir "H:\LaptopBackup\Videos"
 
                rem Change drive to C to action copy
                                C:
                rem Change Directory to Synctoy
                                CD %ProgramFiles%\SyncToy 2.1
                rem Setup SyncToy Folders for Windows 7
                                SyncToy.exe
                                SyncToy.exe -d(left="%USERPROFILE%\Desktop",right="H:\LaptopBackup\Desktop",name=Desktop,operation=Echo)
                                SyncToy.exe -d(left="%USERPROFILE%\Favorites",right="H:\LaptopBackup\Favorites",name=Favorites,operation=Echo)
                                SyncToy.exe -d(left="%USERPROFILE%\Documents",right="H:\LaptopBackup\Documents",name=Docs,operation=Echo)
                                SyncToy.exe -d(left="%USERPROFILE%\Downloads",right="H:\LaptopBackup\Downloads",name=Downloads,operation=Echo)
                                SyncToy.exe -d(left="%USERPROFILE%\Music",right="H:\LaptopBackup\Music",name=Music,operation=Echo)
                                SyncToy.exe -d(left="%USERPROFILE%\Pictures",right="H:\LaptopBackup\Pictures",name=Pictures,operation=Echo)
                                SyncToy.exe -d(left="%USERPROFILE%\Videos",right="H:\LaptopBackup\Videos",name=Videos,operation=Echo)
 
                rem Clear Screen to make it easier to view next message
                                CLS
                rem Copy Complete Echo and Pause
                                ECHO Setup of SyncToy is now Complete.  Files are setup to be backed up to H:\LaptopBackup\.  Please open SyncToy and run a backup now.
                                                PAUSE
                                                                EXIT
:BrowseFolder 
                rem Set Temporary files
                rem Below is the Visual Basic Script, do not indent!
                                set vbs=%temp%\_.vbs
                                set tmp=%temp%\_.cmd
 
> "%vbs%" echo set WshShell=WScript.CreateObject("WScript.Shell")
>>"%vbs%" echo set shell = WScript.CreateObject("Shell.Application")
>>"%vbs%" echo set folder=shell.BrowseForFolder(0,"Select Backup Location",0)
>>"%vbs%" echo if typename(folder)="Nothing" Then
>>"%vbs%" echo wscript.echo "set backupdir=Dialog Cancelled"
>>"%vbs%" echo WScript.Quit(1)
>>"%vbs%" echo end if
>>"%vbs%" echo set folderItems=folder.Items()
>>"%vbs%" echo set folderItem=folderItems.Item()
>>"%vbs%" echo pathname=folderItem.Path
>>"%vbs%" echo wscript.echo "set backupdir="^& chr(34) ^& pathname ^& chr(34)
 
                rem Run the script with WSH
                                cscript //nologo "%vbs%" > "%tmp%"
 
                rem Read the output file and set Path as Env variable %backupdir%
                                for /f "delims=" %%a in (%tmp%) do %%a
                rem Clear up
                                DEL %VBS%
                                DEL %TMP%
                rem Finished now go to copy
                                goto :sub_synctoysetup
                                                                
 
:sub_wrongos
                rem Wrong Operating System Detected, echo and exit
                                CLS
                                                ECHO This script is only supported on Windows 7.  You are running
                                                                ver
                                                                                PAUSE
                                                                                                EXIT
:EOF
                rem End of File Catch for Errors
                                ECHO End of file called!
                                                PAUSE
                                                                EXIT

Simple backup and restore scripts

Published / by Chris Smith / Leave a Comment

Back when my workplace migrated from Windows XP to Windows 7, I became lazy and automated backing up and restoring a users profiles important files in a batch script.
Here I backup to the drive H, this drive is pretty much our standard user drive. If the user does not have a H drive some pretty neat code from https://groups.google.com/forum/#!topic/alt.msdos.batch.nt/kOsN-QIOYEY displays a folder selection box (As annoyingly some users didn’t have their home drive set as H). Although I have set the filepath as LaptopBackup I have used it on Desktops as well.
The code deliberately terminates if it detects it isn’t on Windows 7, this is purely because I haven’t tested this in a network environment on other OS’s!
Known faults are pinned shortcuts in the taskbar don’t appear and printer settings don’t migrate (I never got around to correcting it).

This section of code is to backup to %backupdir%\LaptopBackup\

Echo Off
rem Batch Script to Copy certain folders for the convenience of Users.  The batch file backs up to the H drive, which is a standard drive for user folders.  Tested on Windows 7 for standard Users.
rem Changed backup folder location to something that is more suitable.  Removed printer backup as it doesnt work and added Signature Backup 10/03/2015.
rem Additional Credits https://groups.google.com/forum/#!topic/alt.msdos.batch.nt/kOsN-QIOYEY for on the fly generation of VBS code
 
                REM Check Windows Version is 7
                                ver | findstr /i "6\.1\." > nul
                                IF %ERRORLEVEL% EQU 0 goto sub_begincheck
                                                goto sub_wrongos
:sub_begincheck
                rem If Homedrive is H begin copy
                                if "%homedrive%"=="H:" goto sub_sethomedrive
                rem If Homedrive is not H: ask for new filepath
                                                ECHO Please select a location to backup the profile, it must be contained in a folder even if on an external drive due to a limiation in this script!!!
                                                                PAUSE
                                                                                goto BrowseFolder                         
:sub_sethomedrive
                rem Setup Backupdir variable to homedrive
                                Set backupdir=%homedrive%
:sub_begincopy
                rem Create Directory Structure
                                ECHO Creating Directories
                                mkdir "%backupdir%\LaptopBackup\"
                                mkdir "%backupdir%\LaptopBackup\Desktop"
                                mkdir "%backupdir%\LaptopBackup\Favorites"
                                mkdir "%backupdir%\LaptopBackup\Recent"
                                mkdir "%backupdir%\LaptopBackup\Documents"
                                mkdir "%backupdir%\LaptopBackup\Downloads"
                                mkdir "%backupdir%\LaptopBackup\Outlook"
                                mkdir "%backupdir%\LaptopBackup\Outlook\Application Data"
                                mkdir "%backupdir%\LaptopBackup\Links"
                                mkdir "%backupdir%\LaptopBackup\Music"
                                mkdir "%backupdir%\LaptopBackup\Pictures"
                                mkdir "%backupdir%\LaptopBackup\Videos"
                                mkdir "%backupdir%\LaptopBackup\Contacts"
                                mkdir "%backupdir%\LaptopBackup\SyncToy"
                                mkdir "%backupdir%\LaptopBackup\Sticky Notes"
                                mkdir "%backupdir%\LaptopBackup\OfficeQuickAccess"
                                mkdir "%backupdir%\LaptopBackup\ShortcutsPinned"
                rem Added Signatures
                                mkdir "%backupdir%\LaptopBackup\Signatures"
                rem Change drive to C to action copy
                                C:
                rem Use robocopy to copy specific folders and Echo Folder Copies, amended December 2013 so smaller files copied first and setup on new machine can be started earlier, amended March 2014 to include Quick Access and Pinned Shortcuts
                                ECHO Copying Files and Folders from %LOCALAPPDATA%\Local\Microsoft\Office
                                                robocopy "%LOCALAPPDATA%\Microsoft\Office" "%backupdir%\LaptopBackup\OfficeQuickAccess" *.officeUI /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned
                                                robocopy "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned" "%backupdir%\LaptopBackup\ShortcutsPinned" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %LOCALAPPDATA%\microsoft\synctoy\2.0
                                                robocopy "%LOCALAPPDATA%\microsoft\synctoy\2.0" "%backupdir%\LaptopBackup\SyncToy" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Application Data\Microsoft\Outlook
                                                robocopy "%AppData%\Microsoft\Outlook" "%backupdir%\LaptopBackup\Outlook\Application Data" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Links
                                                robocopy "%USERPROFILE%\Links" "%backupdir%\LaptopBackup\Links" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from "%AppData%\Microsoft\Sticky Notes"
                                                robocopy "%AppData%\Microsoft\Sticky Notes" "%backupdir%\LaptopBackup\Sticky Notes" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Favorites
                                                robocopy "%USERPROFILE%\Favorites" "%backupdir%\LaptopBackup\Favorites" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Recent
                                                robocopy "%USERPROFILE%\Recent" "%backupdir%\LaptopBackup\Recent" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %AppData%\Microsoft\Signatures
                                                robocopy "%AppData%\Microsoft\Signatures" "%backupdir%\LaptopBackup\Signatures" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Desktop
                                                robocopy "%USERPROFILE%\Desktop" "%backupdir%\LaptopBackup\Desktop" /E /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Documents
                                                robocopy "%USERPROFILE%\Documents" "%backupdir%\LaptopBackup\Documents" /E /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Downloads
                                                robocopy "%USERPROFILE%\Downloads" "%backupdir%\LaptopBackup\Downloads" /E /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Music
                                                robocopy "%USERPROFILE%\Music" "%backupdir%\LaptopBackup\Music" /E /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\Pictures
                                                robocopy "%USERPROFILE%\Pictures" "%backupdir%\LaptopBackup\Pictures" /E /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders from %USERPROFILE%\My Videos
                                                robocopy "%USERPROFILE%\Videos" "%backupdir%\LaptopBackup\Videos" /E /MT:6 /R:1 /V /W:1
                                ECHO Saving Printer Settings doesnt work commented out.
                                                rem "%windir%\System32\spool\tools\PrintBrm.exe" -B -F %backupdir%\LaptopBackup\Printers.cab
                rem Clear Screen to make it easier to view next message
                                CLS
                rem Copy Complete Echo and Pause
                                ECHO Backup copy now complete, please check and ensure your files have been copied in the folder %backupdir%
                                                PAUSE
                                                                EXIT
:BrowseFolder 
                rem Set Temporary files
                rem Below is the Visual Basic Script, do not indent!
                                set vbs=%temp%\_.vbs
                                set tmp=%temp%\_.cmd
 
> "%vbs%" echo set WshShell=WScript.CreateObject("WScript.Shell")
>>"%vbs%" echo set shell = WScript.CreateObject("Shell.Application")
>>"%vbs%" echo set folder=shell.BrowseForFolder(0,"Select Backup Location",0)
>>"%vbs%" echo if typename(folder)="Nothing" Then
>>"%vbs%" echo wscript.echo "set backupdir=Dialog Cancelled"
>>"%vbs%" echo WScript.Quit(1)
>>"%vbs%" echo end if
>>"%vbs%" echo set folderItems=folder.Items()
>>"%vbs%" echo set folderItem=folderItems.Item()
>>"%vbs%" echo pathname=folderItem.Path
>>"%vbs%" echo wscript.echo "set backupdir="^& chr(34) ^& pathname ^& chr(34)
 
                rem Run the script with WSH
                                cscript //nologo "%vbs%" > "%tmp%"
 
                rem Read the output file and set Path as Env variable %backupdir%
                                for /f "delims=" %%a in (%tmp%) do %%a
                rem Clear up
                                DEL %VBS%
                                DEL %TMP%
                rem Finished now go to copy
                                goto :sub_begincopy
                                                                
:sub_wrongos
                rem Wrong Operating System Detected, echo and exit
                                CLS
                                                ECHO This script is only supported on Windows 7.  You are running
                                                rem Use ver command
                                                                ver
                                                                                PAUSE
                                                                                                EXIT
:EOF
                rem End of File Catch for Errors
                                ECHO End of file called!
                                                PAUSE
                                                                EXIT

This section of code is to restore from %backupdir%\LaptopBackup\

Echo Off
rem Batch Script to Copy certain folders for the convenience of Users.  Tested on Windows 7 for standard Users.
rem Removed printer restore as it doesnt work and added Signature Restore 10/03/2015.
rem Additional Credits https://groups.google.com/forum/#!topic/alt.msdos.batch.nt/kOsN-QIOYEY for on the fly generation of VBS code
 
                REM Check Windows Version is 7
                                ver | findstr /i "6\.1\." > nul
                                IF %ERRORLEVEL% EQU 0 goto sub_begincheck
                                                goto sub_wrongos
:sub_begincheck
                rem If Homedrive is H begin copy
                                if "%homedrive%"=="H:" goto :sub_sethomedrive
                rem If Homedrive is not H: ask for new filepath
                                                ECHO Please select a location to backup the profile, it must be contained in a folder even if on an external drive due to a limiation in this script!!!
                                                                PAUSE
                                                                                goto BrowseFolder         
:sub_sethomedrive
                rem Setup Backupdir variable to homedrive
                                Set backupdir=%homedrive%
:sub_begincopy
                rem Change drive to C to setup local folders
                                C:
                rem Create Directory Structure
                                mkdir "%AppData%\Microsoft"
                                mkdir "%AppData%\Microsoft\Outlook"
                                mkdir "%AppData%\Microsoft\Signatures"
                                mkdir "%LOCALAPPDATA%\microsoft\synctoy"
                                mkdir "%LOCALAPPDATA%\microsoft\synctoy\2.0"
                rem Added Sticky Notes 09/09/2013
                                mkdir "%AppData%\Microsoft\Sticky Notes"
                rem Added Quick Access and pinned Shortcuts 03/03/2014
                                mkdir "%LOCALAPPDATA%\Microsoft\Office"
                                mkdir "%AppData%\Microsoft\Internet Explorer"
                                mkdir "%AppData%\Microsoft\Internet Explorer\Quick Launch"
                rem Use robocopy to copy specific folders and Echo Folder Copies, changed copy order in December 2013 to help get smaller files required for user setup done first.  Changed March 2013 to include Office Quick Access and Quick Launch
                                ECHO Copying Files and Folders to %LOCALAPPDATA%\Local\Microsoft\Office
                                                robocopy "%backupdir%\LaptopBackup\OfficeQuickAccess" "%LOCALAPPDATA%\Microsoft\Office" *.officeUI /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders to %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned
                                                robocopy "%backupdir%\LaptopBackup\ShortcutsPinned" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders to %LOCALAPPDATA%\microsoft\synctoy\2.0
                                                robocopy "%backupdir%\LaptopBackup\SyncToy" "%LOCALAPPDATA%\microsoft\synctoy\2.0" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Favorites
                                                robocopy "%backupdir%\LaptopBackup\Favorites" "%USERPROFILE%\Favorites" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Links
                                                robocopy "%backupdir%\LaptopBackup\Links" "%USERPROFILE%\Links" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Application Data\Microsoft\Outlook
                                                robocopy "%backupdir%\LaptopBackup\Outlook\Application Data" "%AppData%\Microsoft\Outlook" /E /MT:6 /R:2 /V /W:1
                                ECHO Copy Files and Folder to "%AppData%\Microsoft\Sticky Notes"
                                                robocopy "%backupdir%\LaptopBackup\Sticky Notes" "%AppData%\Microsoft\Sticky Notes" /E /MT:6 /R:2 /V /W:1         
                                ECHO Copying Files and Folders from %AppData%\Microsoft\Signatures
                                                robocopy "%backupdir%\LaptopBackup\Signatures" "%AppData%\Microsoft\Signatures" /S /MT:6 /R:1 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Desktop
                                                robocopy "%backupdir%\LaptopBackup\Desktop" "%USERPROFILE%\Desktop"  /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %AppData%\Microsoft\Windows\Recent
                                                robocopy "%backupdir%\LaptopBackup\Recent" "%AppData%\Microsoft\Windows\Recent" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Documents
                                                robocopy "%backupdir%\LaptopBackup\Documents" "%USERPROFILE%\Documents" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Downloads
                                                robocopy "%backupdir%\LaptopBackup\Downloads" "%USERPROFILE%\Downloads" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\My Music
                                                robocopy "%backupdir%\LaptopBackup\Music" "%USERPROFILE%\Music" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Pictures
                                                robocopy "%backupdir%\LaptopBackup\Pictures" "%USERPROFILE%\Pictures" /E /MT:6 /R:2 /V /W:1
                                ECHO Copying Files and Folders to %USERPROFILE%\Videos
                                                robocopy "%backupdir%\LaptopBackup\Videos" "%USERPROFILE%\Videos" /E /MT:6 /R:2 /V /W:1
                REM Added Sticky Notes and Printer Restore
                                rem ECHO Restoring Printer Settings, this may take a while!
                                                rem "%windir%\System32\spool\tools\PrintBrm.exe" -R -F %backupdir%\LaptopBackup\Printers.cab
                rem Clear Screen to make it easier to view next message
                                CLS
                rem Copy Complete Echo and Pause
                                ECHO Your files from your previous machine have now been restored.
                                ECHO Please ensure you see all your files.
                                                PAUSE
                                                                EXIT
 
:BrowseFolder 
                rem Set Temporary files
                rem Below is the Visual Basic Script, do not indent!
                                set vbs=%temp%\_.vbs
                                set tmp=%temp%\_.cmd
 
> "%vbs%" echo set WshShell=WScript.CreateObject("WScript.Shell")
>>"%vbs%" echo set shell = WScript.CreateObject("Shell.Application")
>>"%vbs%" echo set folder=shell.BrowseForFolder(0,"Select Backup Location",0)
>>"%vbs%" echo if typename(folder)="Nothing" Then
>>"%vbs%" echo wscript.echo "set backupdir=Dialog Cancelled"
>>"%vbs%" echo WScript.Quit(1)
>>"%vbs%" echo end if
>>"%vbs%" echo set folderItems=folder.Items()
>>"%vbs%" echo set folderItem=folderItems.Item()
>>"%vbs%" echo pathname=folderItem.Path
>>"%vbs%" echo wscript.echo "set backupdir="^& chr(34) ^& pathname ^& chr(34)
 
                rem Run the script with WSH
                                cscript //nologo "%vbs%" > "%tmp%"
 
                rem Read the output file and set Path as Env variable %backupdir%
                                for /f "delims=" %%a in (%tmp%) do %%a
                rem Clear up
                                DEL %VBS%
                                DEL %TMP%
                rem Finished now go to copy
                                goto :sub_begincopy
                                                                
:sub_wrongos
                rem Wrong Operating System Detected, echo and exit
                                CLS
                                                ECHO This script is only supported on Windows 7.  You are running
                                                                ver
                                                                                PAUSE
                                                                                                EXIT
:EOF
                rem End of File Catch for Errors
                                ECHO End of file called!
                                                PAUSE
                                                                EXIT

Update August 2017. I have found Windows 10 Sticky Notes needs to be moved to a different location so data can be imported, the below has been added as where I work is currently planning to migrate from Windows 7 to Windows 10.
Further amendments may be needed and obviously the backup script above doesn’t account for the new data location for Sticky Notes.
Corrected restore location of restore script April 2018 (Whoops)

Echo Off
rem Checked to work against Windows 10, stickynotes amended to account for changes
rem Additional Credits https://groups.google.com/forum/#!topic/alt.msdos.batch.nt/kOsN-QIOYEY for on the fly generation of VBS code

	REM Check Windows Version is 10
		ver | findstr /i "10\.0\." > nul
		IF %ERRORLEVEL% EQU 0 goto sub_begincheck
			goto sub_wrongos
:sub_begincheck
	rem If Homedrive is H begin copy
		if "%homedrive%"=="H:" goto :sub_sethomedrive
	rem If Homedrive is not H: ask for new filepath
			ECHO Please select a location to backup the profile, it must be contained in a folder even if on an external drive due to a limiation in this script!!!
				PAUSE
					goto BrowseFolder	
:sub_sethomedrive
	rem Setup Backupdir variable to homedrive
		Set backupdir=%homedrive%
:sub_begincopy
	rem Change drive to C to setup local folders
		C:
	rem Create Directory Structure
		mkdir "%AppData%\Microsoft"
		mkdir "%AppData%\Microsoft\Outlook"
		mkdir "%AppData%\Microsoft\Signatures"
		mkdir "%LOCALAPPDATA%\microsoft\synctoy"
		mkdir "%LOCALAPPDATA%\microsoft\synctoy\2.0"
	rem Added Sticky Notes 09/09/2013
		rem mkdir "%AppData%\Microsoft\Sticky Notes"
	rem http://www.winhelponline.com/blog/recover-backup-sticky-notes-data-file-windows-10/
		mkdir "%LocalAppData%\Local\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\Legacy"
	rem Added Quick Access and pinned Shortcuts 03/03/2014
		mkdir "%LOCALAPPDATA%\Microsoft\Office"
		mkdir "%AppData%\Microsoft\Internet Explorer"
		mkdir "%AppData%\Microsoft\Internet Explorer\Quick Launch"
	rem Use robocopy to copy specific folders and Echo Folder Copies, changed copy order in December 2013 to help get smaller files required for user setup done first.  Changed March 2013 to include Office Quick Access and Quick Launch
		ECHO Copying Files and Folders to %LOCALAPPDATA%\Local\Microsoft\Office
			robocopy "%backupdir%\LaptopBackup\OfficeQuickAccess" "%LOCALAPPDATA%\Microsoft\Office" *.officeUI /MT:6 /R:1 /V /W:1
		ECHO Copying Files and Folders to %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned
			robocopy "%backupdir%\LaptopBackup\ShortcutsPinned" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned" /S /MT:6 /R:1 /V /W:1
		ECHO Copying Files and Folders to %LOCALAPPDATA%\microsoft\synctoy\2.0
			robocopy "%backupdir%\LaptopBackup\SyncToy" "%LOCALAPPDATA%\microsoft\synctoy\2.0" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Favorites
			robocopy "%backupdir%\LaptopBackup\Favorites" "%USERPROFILE%\Favorites" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Links
			robocopy "%backupdir%\LaptopBackup\Links" "%USERPROFILE%\Links" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Application Data\Microsoft\Outlook
			robocopy "%backupdir%\LaptopBackup\Outlook\Application Data" "%AppData%\Microsoft\Outlook" /E /MT:6 /R:2 /V /W:1
		ECHO Copy Files and Folder to "%LocalAppData%\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\Legacy"
	rem Modified for Windows 10 where the folder has changed and the file must bhe imported via a Legavy Folder
			copy "%backupdir%\LaptopBackup\Sticky Notes\StickyNotes.snt" "%LocalAppData%\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\Legacy\ThresholdNotes.snt" /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders from %AppData%\Microsoft\Signatures
			robocopy "%backupdir%\LaptopBackup\Signatures" "%AppData%\Microsoft\Signatures" /S /MT:6 /R:1 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Desktop
			robocopy "%backupdir%\LaptopBackup\Desktop" "%USERPROFILE%\Desktop"  /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %AppData%\Microsoft\Windows\Recent
			robocopy "%backupdir%\LaptopBackup\Recent" "%AppData%\Microsoft\Windows\Recent" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Documents
			robocopy "%backupdir%\LaptopBackup\Documents" "%USERPROFILE%\Documents" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Downloads
			robocopy "%backupdir%\LaptopBackup\Downloads" "%USERPROFILE%\Downloads" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\My Music
			robocopy "%backupdir%\LaptopBackup\Music" "%USERPROFILE%\Music" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Pictures
			robocopy "%backupdir%\LaptopBackup\Pictures" "%USERPROFILE%\Pictures" /E /MT:6 /R:2 /V /W:1
		ECHO Copying Files and Folders to %USERPROFILE%\Videos
			robocopy "%backupdir%\LaptopBackup\Videos" "%USERPROFILE%\Videos" /E /MT:6 /R:2 /V /W:1
	REM Added Sticky Notes and Printer Restore
		rem ECHO Restoring Printer Settings, this may take a while!
			rem "%windir%\System32\spool\tools\PrintBrm.exe" -R -F %backupdir%\LaptopBackup\Printers.cab
	rem Clear Screen to make it easier to view next message
		CLS
	rem Copy Complete Echo and Pause
		ECHO Your files from your previous machine have now been restored.
		ECHO Please ensure you see all your files.
			PAUSE
				EXIT

:BrowseFolder 
	rem Set Temporary files
	rem Below is the Visual Basic Script, do not indent!
		set vbs=%temp%\_.vbs
		set tmp=%temp%\_.cmd

> "%vbs%" echo set WshShell=WScript.CreateObject("WScript.Shell")
>>"%vbs%" echo set shell = WScript.CreateObject("Shell.Application")
>>"%vbs%" echo set folder=shell.BrowseForFolder(0,"Select Backup Location",0)
>>"%vbs%" echo if typename(folder)="Nothing" Then
>>"%vbs%" echo wscript.echo "set backupdir=Dialog Cancelled"
>>"%vbs%" echo WScript.Quit(1)
>>"%vbs%" echo end if
>>"%vbs%" echo set folderItems=folder.Items()
>>"%vbs%" echo set folderItem=folderItems.Item()
>>"%vbs%" echo pathname=folderItem.Path
>>"%vbs%" echo wscript.echo "set backupdir="^& chr(34) ^& pathname ^& chr(34)

	rem Run the script with WSH
		cscript //nologo "%vbs%" > "%tmp%"

	rem Read the output file and set Path as Env variable %backupdir%
		for /f "delims=" %%a in (%tmp%) do %%a
	rem Clear up
		DEL %VBS%
		DEL %TMP%
	rem Finished now go to copy
		goto :sub_begincopy
				
:sub_wrongos
	rem Wrong Operating System Detected, echo and exit
		CLS
			ECHO This script is only supported on Windows 10.  You are running
				ver
					PAUSE
						EXIT
:EOF
	rem End of File Catch for Errors
		ECHO End of file called!
			PAUSE
				EXIT

Old Sites

Published / by Chris Smith / Leave a Comment

This is just a note to acknowledge that back in 2001 until 2011 I hosted a number of Gaming websites for a number of communities.  It generated a whole $100 of revenue (never near the operating costs) but had over 20 million page views and allowed me to develop skills as a system administrator on CentOS, cPanel and various scripts which were utilised.  We went from simple shared hosting to using multiple Dedicated Servers during our peak:

Special thank’s goes to:
Half Life Improvement Team (Matt, AI and many others not mentioned)
LaggedRabbit for help with Sven Co-op Central
The BP Kr3w (Luke, Simon, Rob, Ali, Hammi, Phil and many others not mentioned)
The Lanning Crews (FrictionLan, FossLan, SIRLan)
Shawson for the designing the iconic BuLLetPain website and for the awesome Shawson&Co adventures which spawned its own website.
With Friends Like These (Lurid, Wrin, Kain and many others not mentioned)
Every clan we supported
BBQWitTehBear
SirTart (For classic whitty banter)
UKDedicated, Sagonet, Layeredtech who have hosted us over the years and provided our many download mirrors for BuLLetFiles and Sven Co-op Central.
ikonboard (The first forum used by BuLLetPain) and InvisionBoard (Used during BuLLetPain’s most popular years)
e107 (Which powered Sven Co-op Central)
RWScripts (Which powered BuLLetFiles)
BuLLetPain was started in December 2001 and closed in 2006-7 but continued supporting communities into 2011 until Sven Co-op Central closed.