C:\_G\WWW\~ELISANET\INFO\tscmd168.html
<http://www.elisanet.fi/tsalmi/info/tscmd168.html>
Copyright © 2003- by Prof. Timo Salmi  
Last modified Fri 7-Dec-2018 10:59:13

 
Assorted NT/2000/XP/.. CMD.EXE Script Tricks
From the html version of the tscmd.zip 1cmdfaq.txt file
To the Description and the Index
 

This page is edited from the 1cmdfaq.txt faq-file contained in my tscmd.zip command line interface (CLI) collection. That zipped file has much additional material, including a number of detached .cmd script files. It is recommended that you also get the zipped version as a companion.

Please see "The Description and the Index page" for the conditions of usage and other such information.



168} How do I invoke Safely Remove Hardware using a cmd script?

Usually the notification area includes the following icon

However, that icon sometimes disappears. In that case safely to remove hardware, and to get the icon back, you can use
@echo off & setlocal enableextensions
echo RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll
:_ask
set ask_=
set /p ask_="Run this script to Safely Remove Hardware [N/y]?"
if /i "%ask_%"=="n" goto :EOF
if /i "%ask_%"=="" goto :EOF
if /i not "%ask_%"=="y" goto _ask
RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll
endlocal & goto :EOF

Windows XP An appropriate icon for the script is given by


Something like the following will pop up

On Windows 10



Similar references/comments:
  Safely Remove Hardware Icon not in Taskbar when flashdrive is plugged in

[Previous] [Next]

C:\_G\WWW\~ELISANET\INFO\tscmd168.html
C:\_G\WWW\~ELISANET\FTPCMD\TSALMI.CMD /tscmd168
http://www.elisanet.fi/tsalmi/info/tscmd168.html
file:///c:/_g/www/~elisanet/info/tscmd168.html