Answer the question
In order to leave comments, you need to log in
Which cmd command can eject a flash drive in Windows?
If it is possible with examples, otherwise I am not familiar with cmd syntax.
The command will be used in a bat-file, which, when a flash drive is inserted, copies files from a certain folder to it and, when finished, should automatically extract the flash drive.
Answer the question
In order to leave comments, you need to log in
From the flash drive itself:
@echo off
echo var shell = new ActiveXObject("Shell.Application");>"%temp%\ej.js"
echo shell.NameSpace(17).ParseName("%cd:~0,-1%").InvokeVerb("Eject");>>"%temp%\ej.js"
echo WSH.Sleep(2000);>>"%temp%\ej.js"
cd /d %systemdrive%\
start "" /MIN cmd /c "wscript.exe //Nologo "%temp%\ej.js""
@if (0 == 1) @end
var shell = new ActiveXObject("Shell.Application");
shell.NameSpace(17).ParseName("G:").InvokeVerb("Eject");
WSH.Sleep(2000);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question