Now I can remove my USB stick without the risk of loosing data (AFAIK PE lacks of this functionality or I just don't know how to do it).
There are more options such as device id or device name. Refer to the commandline output for the syntax of DevEject.
@Bart: I've adapted your checkdisk.cmd to fit my needs.
deveject.cmd
CODE
@echo off
rem deveject.cmd
rem Created by Bart Lagerweij, modified by Kalonji
setlocal
echo DEVEJECT.CMD: Starting...
echo.
%~d0
cd "%~dp0"
set _drive=
echo Please enter the drive to unmount (for example "x:" or "all" for all
echo attached USB mass storage devices)...
set /p _drive=Enter drive:
if "%_drive%" == "" goto _end
if "%_drive%" == "all" goto _all
:_run
echo Running: deveject.exe -EjectDrive:%_drive%
deveject.exe -EjectDrive:%_drive%
echo.
goto _end
:_all
echo Running: deveject.exe -EjectName:"USB Mass Storage Device"
deveject.exe -EjectName:"USB Mass Storage Device"
echo.
goto _end
:_end
echo.
pause
endlocal
rem deveject.cmd
rem Created by Bart Lagerweij, modified by Kalonji
setlocal
echo DEVEJECT.CMD: Starting...
echo.
%~d0
cd "%~dp0"
set _drive=
echo Please enter the drive to unmount (for example "x:" or "all" for all
echo attached USB mass storage devices)...
set /p _drive=Enter drive:
if "%_drive%" == "" goto _end
if "%_drive%" == "all" goto _all
:_run
echo Running: deveject.exe -EjectDrive:%_drive%
deveject.exe -EjectDrive:%_drive%
echo.
goto _end
:_all
echo Running: deveject.exe -EjectName:"USB Mass Storage Device"
deveject.exe -EjectName:"USB Mass Storage Device"
echo.
goto _end
:_end
echo.
pause
endlocal
deveject.inf
CODE
; deveject.inf
; PE Builder v3 plug-in INF file for DevEject
; Created by Bart Lagerweij
[Version]
Signature= "$Windows NT$"
[PEBuilder]
Name="DevEject"
Enable=1
Help="deveject.htm"
[WinntDirectories]
a=Programs\deveject,2
[SourceDisksFiles]
deveject.cmd=a,,1
deveject.exe=a,,1
[Append]
nu2menu.xml, deveject_nu2menu.xml
; PE Builder v3 plug-in INF file for DevEject
; Created by Bart Lagerweij
[Version]
Signature= "$Windows NT$"
[PEBuilder]
Name="DevEject"
Enable=1
Help="deveject.htm"
[WinntDirectories]
a=Programs\deveject,2
[SourceDisksFiles]
deveject.cmd=a,,1
deveject.exe=a,,1
[Append]
nu2menu.xml, deveject_nu2menu.xml
deveject_nu2menu.xml
CODE
<!-- Nu2Menu entry for DevEject -->
<NU2MENU>
<MENU ID="Storage">
<MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\deveject\deveject.cmd))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\deveject\deveject.cmd">DevEject</MITEM>
</MENU>
</NU2MENU>
<NU2MENU>
<MENU ID="Storage">
<MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\deveject\deveject.cmd))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\deveject\deveject.cmd">DevEject</MITEM>
</MENU>
</NU2MENU>
deveject.htm
CODE
<html>
<head></head>
<body>
<i>PE Builder v3 plugin</i>
<hr>
<h1>DevEject</h1>
<h3>Plugin by Kalonji</h3>
<a target="_blank" href="http://www.heise.de/ct/03/25/links/206.shtml">DevEject</a>
by Matthias Withopf (c't magazine).<br>
<br>
DevEject is created to unmount external storage devices such as FireWire or USB drives<br>
by entering the corresponding driveletter. DevEject is free for use!
<br>
<br>
Before you can use the plugin you must copy some files to the plugin directory.<br>
<a target="_blank" href="ftp://ftp.heise.de/pub/ct/listings/0316-208.zip">Download</a> DevEject.
Copy the following files into
the <tt>plugin\deveject</tt> directory:<br>
<tt>deveject.cmd, deveject.exe, deveject.inf, deveject.htm, deveject_nu2menu.xml</tt><br>
<br>
<hr>
<i>PE Builder
Copyright (c) 2002-2003 Bart Lagerweij. All rights reserved.</i><br>
</body>
</html>
<head></head>
<body>
<i>PE Builder v3 plugin</i>
<hr>
<h1>DevEject</h1>
<h3>Plugin by Kalonji</h3>
<a target="_blank" href="http://www.heise.de/ct/03/25/links/206.shtml">DevEject</a>
by Matthias Withopf (c't magazine).<br>
<br>
DevEject is created to unmount external storage devices such as FireWire or USB drives<br>
by entering the corresponding driveletter. DevEject is free for use!
<br>
<br>
Before you can use the plugin you must copy some files to the plugin directory.<br>
<a target="_blank" href="ftp://ftp.heise.de/pub/ct/listings/0316-208.zip">Download</a> DevEject.
Copy the following files into
the <tt>plugin\deveject</tt> directory:<br>
<tt>deveject.cmd, deveject.exe, deveject.inf, deveject.htm, deveject_nu2menu.xml</tt><br>
<br>
<hr>
<i>PE Builder
Copyright (c) 2002-2003 Bart Lagerweij. All rights reserved.</i><br>
</body>
</html>
Cheers, Kalonji.
