TI 2017: Post-backup command runs very differently inside TI-2017 than from command window
Is there something I'm missing here that would allow the post-backup devcon commands to run normally inside TI-2017?
I have batch files that are run as pre- and post-backup commands to effectively mount and dismount my external hard drive for my nightly backup. I do this to avoid having the drives on the machine write-enabled except when they're being used for backup or restore.
The post-backup command acts quite differently when it's run from an "elevated" command window than it does when run inside of TI-2017.
When run from an elevated command window as Administrator, the disable of the device completes normally.
When run from inside TI 2017, the device will not be disabled until the system is rebooted.
I see the same effect on both Windows 7 Pro SP1 64-bit and Windows 10 Pro 64-bit. The drive on the Windows 7 system is eSATA, while the drive on the Windows 10 system is USB.
I normally shutdown the systems after the backup, so this isn't usually a problem. However, I occasionally leave the machines running over night for some long-running tasks.
He're what I see when it's run in a command window:
C:\Windows\system32>postbackupcommands
C:\Windows\system32>sync64 h:
Sync v2.2 - Flush cached data to disk.
Copyright (C) 2016 Mark Russinovich
Sysinternals - www.sysinternals.comFlushing: H
C:\Windows\system32>mountvol h:\ /d
C:\Windows\system32>devcon disable *SAMSUNG*
USBSTOR\DISK&VEN_SAMSUNG&PROD_STORY_STATION_P&REV_\00000011E09310B005EF&0: Disabled
1 device(s) disabled.C:\Windows\system32>devcon restart *SAMSUNG*
USBSTOR\DISK&VEN_SAMSUNG&PROD_STORY_STATION_P&REV_\00000011E09310B005EF&0: Restarted
1 device(s) restarted.C:\Windows\system32>devcon rescan
Scanning for new hardware.
Scanning completed.
Here's what I see when it's run from inside TI 2017 (the commands don't actually appear in the captured output; I've added them here for clarity):
>sync64 h:
Flushing: H
>mountvol h:\ /d
>devcon disable *SAMSUNG*
USBSTOR\DISK&VEN_SAMSUNG&PROD_STORY_STATION_P&REV_\00000011E09310B005EF&0: Disabled on reboot
The 1 device(s) are ready to be disabled. To disable the devices, restart the
devices or reboot the system .>devcon restart *SAMSUNG*
USBSTOR\DISK&VEN_SAMSUNG&PROD_STORY_STATION_P&REV_\00000011E09310B005EF&0: Requires reboot
The 1 device(s) are ready to be restarted. To restart the devices, reboot the system.>devcon rescan
Scanning for new hardware.
Scanning completed.