CJSmith dot me

I dump stuff I find useful here

Category: Windows 7

Disable Powerpoint 2016 extended display mode

Published / by Chris Smith / Leave a Comment

Credit: http://tips.timscomputer.com/disable-powerpoint-2013-extended-display-mode-via-registry/
Disable the extended display mode upon login, same as the link just modified the version from 15 to 16

Run the following as a batch file upon login

@echo off
reg add HKCU\Software\Microsoft\Office\16.0\PowerPoint\Options /v UseMonMgr /t REG_DWORD /d 0 /f

With a faulty drive stop Windows from mounting

Published / by Chris Smith / Leave a Comment

Credit: A Video from Linus Tech Tips reminded me of a way to stop Windows 7/10 from automounting drives

If you have an issue with a hard drive (That is spinning up, doesn’t sound like its head is craching/clicking and a SMART tool like CrystalDiskInfo Standard edition shows its healthy) that simply appears to hang your machine/take forever to mount, Windows can annoy you by attempting to mount drives. Windows can be told not to mount new drives so it can be told to not mount and forget older external drives which were plugged in.
This is useful if you want to drive and image the drive with software (If you don’t have a stand alone duplicator).

diskpart
automount disable
automount scrub
exit

Autoscrub disable means you don’t have to modify the windows registry.
Automount scrub means you don’t have to remove the device from device manager (Often a pain with lots of external drives)

Obviously afterwards re-enable to restore default functionality

diskpart
automount enable
exit

Getting a Kodak i160 to work on a KEC 1582t card in Windows 7

Published / by Chris Smith / Leave a Comment

We had an issue where a Kodak i160 scanner would appear when a Windows 7 machine booted but then disappear after the Kodak i160 scanner went to sleep.
The Kodak scanner was using a Kofax Virtual Rescan driver, after some checking it turned out the machine was using a standard fire wire driver for the KEC 1582t PCI card which worked fine on Windows XP Professional SP3.

The way around this was to use a legacy driver which is included as part of Windows 7 (It appears to work with a number of other fire wire cards as well for slow performance).

Windows 8 doesn’t have this driver as part of the OS and it can be obtained from Microsoft Support
The original MS article announcing this seems to show it doesn’t work for Windows 10, however a website called Studio 1 seems to show it does. I haven’t tested this as the Kodak i160 Scanner has no Windows 10 support, the parts are difficult to get hold of and therefore we are replacing them.

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