S
S
ssssergey2015-01-27 16:59:05
Command line
ssssergey, 2015-01-27 16:59:05

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

4 answer(s)
A
Anton Fedoryan, 2015-01-27
@AnnTHony

The search seems to be out of whack too.

A
Artyom Sysolyatin, 2015-01-27
@pingvi69

What for?

M
Max Payne, 2015-01-27
@YardalGedal

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

From a PC, but you need to know the drive letter:
@if (0 == 1) @end 
var shell = new ActiveXObject("Shell.Application");
shell.NameSpace(17).ParseName("G:").InvokeVerb("Eject");
WSH.Sleep(2000);

A
Armenian Radio, 2015-01-27
@gbg

RemoveDrive program , for example. Program website .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question