| View previous topic :: View next topic |
| Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon Aug 23, 2010 1:20 am Post subject: Safely remove USB Pen |
|
|
Hi guyz,
it's possible safely remove an usb pen in Vds's script?
Byez |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Mon Aug 23, 2010 11:09 pm Post subject: |
|
|
I use the freeware utility called USB Disk Ejector http://quick.mixnmojo.com/ and I have used NIRCmd.exe (you'll have to google it, I don't remember the website). I haven't been able to find a way to safely eject a usb drive using just VDS. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 24, 2010 9:10 pm Post subject: |
|
|
Hi LiquidCode
thankyou for your notice, but I know these softwares and sometimes use, maybe I didn't explained well what I need, sorry, I need a vdsscript to safely remove usb pen.
it's possible create this Vds script and how?
thanks again
Cheers |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 24, 2010 10:07 pm Post subject: |
|
|
Thanks LiquidCode for your info
I will try it
Many thanks  |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Wed Aug 25, 2010 10:46 am Post subject: |
|
|
HI LiquidCode,
Maybe dll work, I must only resolve the closing of all task active on usb pen
Thank's again |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Fri Aug 27, 2010 12:10 am Post subject: |
|
|
| Tdk161, If you understand API the GadgetX.dll can do it. |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Sun Aug 29, 2010 1:20 pm Post subject: |
|
|
Aslan,
Unfortunatly I don't understand so much API
Byez and tnx  |
|
| Back to top |
|
 |
scotspgc Newbie
Joined: 13 Dec 2006 Posts: 4
|
Posted: Tue Aug 31, 2010 3:38 am Post subject: |
|
|
You can use the windows rundll32.exe option also.
"RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll"
I use that command for windows XP and Windows 7.
Sorry, I think I misunderstood. Are you trying to eject the device automatically? |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 31, 2010 2:38 pm Post subject: |
|
|
Hi scotspgc
I already know tjis, and usually use it in my script, I would like when application on usb pen is cloding, show a message box asking to remove usb pen and automaticaly temove it without using external command/application.
But thank you for your help
Byez |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Tue Aug 31, 2010 4:18 pm Post subject: |
|
|
Hi Tdk161:
I've been looking for an application to eject a pendrive (free, of course) ... and I think this one can be usefull:
http://dl.dropbox.com/u/921248/EjectUSB.zip
Good luck! |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 31, 2010 6:10 pm Post subject: |
|
|
Hi Uvedese
I kmow this utility, and sometime I use, it is build with Autoit language, but as I said before I woul like use a routine write in Vds as an internal command in my vds script
Thank you nice info
Byez |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Wed Sep 01, 2010 3:24 pm Post subject: |
|
|
I'm sorry Tdk161
I'm looking for the source code (in Borland Delphi) in order to eject a USB drive.
This page is in Spanish but it has the source code of an application that does eject (for example) a Pendrive:
http://www.ajpdsoft.com/modules.php?name=News&file=article&sid=463
I hope it was usefull for you.
Bye  |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Wed Sep 01, 2010 3:53 pm Post subject: |
|
|
More information:
DLL: hotplug.dll
You can eject pendrive calling "HotPlugEjectDevice" function of hotplug.dll Windows library.
| Code: | | function HotPlugEjectDevice(hwndParent: Cardinal; lpDeviceInstanceId: PWideChar): LongBool; stdcall external 'hotplug'; |
WinExec CODE:
| Code: | | WinExec(PChar('c:\windows\system32\rundll32 hotplug.dll,HotplugEjectDevice '),SW_SHOWNORMAL); |
This way, a window appears for safely remove an usb pen:
| Code: | | WinExec(PChar('c:\windows\system32\rundll32 shell32.dll,Control_RunDLL hotplug.dll'),SW_SHOWNORMAL); |
I do not know if you clarify something and if it can adapt to VDS.
Good luck
Extracted and translated from:
http://delphimagic.blogspot.com/2009_06_01_archive.html
____________
uVeDeSe
____________ |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon Sep 06, 2010 9:27 am Post subject: |
|
|
Hi Uvedese
thank you , I'm trying your idea
Thank you very much
Byez |
|
| Back to top |
|
 |
|