Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello sir,
i m doing project in java in which i want pendrive to be
automatically Safely Removed if it is not scan 4 virus...So
how can i Automatically safely remove pendrive through mine
java or C program??? and also how to detect whether the
device connected to the USB port in mass storage device
(i.e pendrive...)through java or C program...waiting 4
reply....
Posted

You cannot /safely remove/ the device programatically.

If you intend to ensure the device is in a safe state, then Java is not the option as this would be too low level for the JVM.
 
Share this answer
 
use jni.
(java native interface).

for jni :


http://patriot.net/~tvalesky/jninative.html

https://sites.google.com/site/stark9000/java-native-interface-helloworld



this will be help full ->

http://www.codeproject.com/KB/system/RemoveDriveByLetter.aspx

http://www.codeproject.com/KB/system/usbeject.aspx

http://www.rohitab.com/discuss/topic/34669-ejecting-a-flash-drive-using-vb/

http://www.autohotkey.com/forum/topic8923.html

http://www.xtremevbtalk.com/archive/index.php/t-239209.html
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900