I dump stuff I find useful here

Category: Windows 10

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).

Using Disk Part

MS DOS

1

2

3

4

diskpart

automountdisable

automountscrub

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)

I had a USB device that I could not unload, I prefer the old dialog box anyway and found it is still possible to show this box in Windows 10. The forum post above has the answer, however according to someone was a very poor answer. For me the answer from “Waseemulla S” worked exactly as expected, it was then I found the USB Caddy I had plugged in didn’t support stopping the USB device in this way. Waseemulla S’s steps are below (I see no need to change it)

Create a batch file that will prompt you to “Safe to remove Hardware” with just a click.
Open notepad and type

MS DOS

1

“rundll32shell32.dll,Control_RunDLLhotplug.dll”

Click save as and change file type to all files, type the file name Filename.bat (Where Filename is the name of your choice)
Double click the file anytime you want to get “Safe to remove Hardware” prompt.

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.

A number of the default “apps” that Microsoft provide tend to get on my nerves, as I have Skype and Office already installed I was annoyed to see the “Get Skype” and “Get Office” were listed.
I tweak the below on all new machines as some members of my family do have a Windows Phone (So in some instances I leave windowsphone and people).

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).

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 is7

ver|findstr/i"6\.1\.">nul

IF%ERRORLEVEL%EQU0gotosub_begincheck

gotosub_wrongos

:sub_begincheck

rem IfHomedrive isHbegin copy

if"%homedrive%"=="H:"gotosub_sethomedrive

rem IfHomedrive isnotH:ask fornewfilepath

ECHO Please selectalocation tobackup the profile,it must be contained inafolder even ifon an external drive due toalimiation inthisscript!!!

PAUSE

gotoBrowseFolder

:sub_sethomedrive

rem Setup Backupdir variable tohomedrive

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

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)

Corrections for Windows 10 Sticky Note App change

MS DOS

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

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

REMCheckWindowsVersionis10

ver|findstr/i"10\.0\.">nul

IF%ERRORLEVEL%EQU0gotosub_begincheck

gotosub_wrongos

:sub_begincheck

remIfHomedriveisHbegincopy

if"%homedrive%"=="H:"goto:sub_sethomedrive

remIfHomedriveisnotH:askfornewfilepath

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!!!

remUserobocopytocopyspecificfoldersandEcho 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