Go Back   TechArena Community > Technical Support > Computer Help > Windows XP > XP Hardware
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



Re-detect a USB device without Unplugging and Replugging

XP Hardware


Reply
 
Thread Tools Search this Thread
  #1  
Old 08-04-2007
Nanda
 
Posts: n/a
Re-detect a USB device without Unplugging and Replugging

synopsis :

Do we have a way to make windows detect a usb device once it is marked for
'safe removal'

Details :

I use windows xp with all latest patches,
i use a usb flash device to exchange data between work and home. Every time
i unplug the usb drive using the system tray icon, the un-mountings of the
usb device happens without any glitches. But i want the device to be
re-detected without a physical removal & plugging. i tried the "Add Hardware"
.. i fails with the below shown message

"Windows cannot use this hardware device because it has been prepared for
'safe removal', but it has not been removed from the computer. (Code 47)

To fix this problem, unplug this device from your computer and then plug it
in again."

though this pretty much explains what i should do,
is there a way to bypass this and re-detect my device.

Thanks
Reply With Quote
  #2  
Old 08-04-2007
David Vair
 
Posts: n/a
Re: Re-detect a USB device without Unplugging and Replugging

Why would you use the safely remove device if you don't want to remove it? When you tell Windows
that you want to remove the device the system wil make it so that no information can be written to
it, that way nothing is lost. Only way to get it to be recognized is to remove and reinsert.
--
Dave Vair
CNE, CNA, MCP, A+, N+

"Nanda" <Nanda@discussions.microsoft.com> wrote in message
news:0BCD976E-561E-482D-A24F-0C5042B967FF@microsoft.com...
> synopsis :
>
> Do we have a way to make windows detect a usb device once it is marked for
> 'safe removal'
>
> Details :
>
> I use windows xp with all latest patches,
> i use a usb flash device to exchange data between work and home. Every time
> i unplug the usb drive using the system tray icon, the un-mountings of the
> usb device happens without any glitches. But i want the device to be
> re-detected without a physical removal & plugging. i tried the "Add Hardware"
> . i fails with the below shown message
>
> "Windows cannot use this hardware device because it has been prepared for
> 'safe removal', but it has not been removed from the computer. (Code 47)
>
> To fix this problem, unplug this device from your computer and then plug it
> in again."
>
> though this pretty much explains what i should do,
> is there a way to bypass this and re-detect my device.
>
> Thanks



Reply With Quote
  #3  
Old 09-04-2007
Pavel A.
 
Posts: n/a
Re: Re-detect a USB device without Unplugging and Replugging

Yes it's possible to clear the remove flag and reenumerate the device
using API, though I can't remember any ready tool for this.

--PA

"Nanda" <Nanda@discussions.microsoft.com> wrote in message news:0BCD976E-561E-482D-A24F-0C5042B967FF@microsoft.com...
> synopsis :
>
> Do we have a way to make windows detect a usb device once it is marked for
> 'safe removal'
>
> Details :
>
> I use windows xp with all latest patches,
> i use a usb flash device to exchange data between work and home. Every time
> i unplug the usb drive using the system tray icon, the un-mountings of the
> usb device happens without any glitches. But i want the device to be
> re-detected without a physical removal & plugging. i tried the "Add Hardware"
> . i fails with the below shown message
>
> "Windows cannot use this hardware device because it has been prepared for
> 'safe removal', but it has not been removed from the computer. (Code 47)
>
> To fix this problem, unplug this device from your computer and then plug it
> in again."
>
> though this pretty much explains what i should do,
> is there a way to bypass this and re-detect my device.
>
> Thanks



Reply With Quote
  #4  
Old 10-04-2007
Uwe Sieber
 
Posts: n/a
Re: Re-detect a USB device without Unplugging and Replugging


You could deactivate and then reactivate it instaed my means
of Microsoft DEVCON:
http://support.microsoft.com/kb/311272

Samples:
devcon disable USB\VID_067B*PID_2517\6*12115AD4*
devcon enable USB\VID_067B*PID_2517\6*12115AD4*

The device ID you can get by means of my tool
ListUsbDrives which comes with my USBDLM tool:
http://www.uwe-sieber.de/files/usbdlm.zip
Use the 'Ctrl DevID'.

The & character has a special meaning on the XP
commandline, so the best way is to replace it by
asterisks which DEVCON sees as wildcard for 'any char'.


Uwe



Nanda wrote:
> synopsis :
>
> Do we have a way to make windows detect a usb device once it is marked for
> 'safe removal'
>
> Details :
>
> I use windows xp with all latest patches,
> i use a usb flash device to exchange data between work and home. Every time
> i unplug the usb drive using the system tray icon, the un-mountings of the
> usb device happens without any glitches. But i want the device to be
> re-detected without a physical removal & plugging. i tried the "Add Hardware"
> . i fails with the below shown message
>
> "Windows cannot use this hardware device because it has been prepared for
> 'safe removal', but it has not been removed from the computer. (Code 47)
>
> To fix this problem, unplug this device from your computer and then plug it
> in again."
>
> though this pretty much explains what i should do,
> is there a way to bypass this and re-detect my device.
>
> Thanks

Reply With Quote
  #5  
Old 16-01-2009
Mehrdad Mirreza
 
Posts: n/a
Eject and re-detect a usb drive without unplugging it

I needed this too for testing a launcher on my USB flash drive. As I used an old computer without front USB ports and I was too lazy to stand up each time and replug the memory stick I searched for a solution in web. All solutions I found need the Microsoft command line tool DevCon, which is not very straight forward to use, so I tried to find another one. It needs also some clicks, but does without extra tools:

1. push [win]+[Pause] to show the "System Properties" dialog or just pick it from the Control Panel

2. switch to Hardware tab and click on "Device Manager"

3. There you click on "Universal Serial Bus controllers" to open it

4. Below that you see 5 (maybe more or less) items called "USB root Hub". If you know which of them your device is connected to (i.e. through experience) right click it and select "disable", otherwise do that with all of them. WARNING: doing so will disconnect all connected USB devices!

5. Right click the disabled items and select "enable". Your devices are then detected again.

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com/default.aspx?ref=ng
Reply With Quote
  #6  
Old 16-01-2009
Opinicus
 
Posts: n/a
Re: Eject and re-detect a usb drive without unplugging it

<Mehrdad Mirreza> wrote in message news:200911615251mubed@web.de...
>I needed this too for testing a launcher on my USB flash drive.

Needed what?

--
Bob
http://www.kanyak.com
Reply With Quote
  #7  
Old 17-01-2009
Harry
 
Posts: n/a
Re: Eject and re-detect a usb drive without unplugging it

On Jan 15, 10:52*pm, Mehrdad Mirreza wrote:
On Jan 15, 10:52 pm, Mehrdad Mirreza wrote:
>I needed this too for testing a launcher on my USB flash drive. As I
>used an old computer without front USB ports and I was too lazy to stand
>up each time and replug the memory stick I searched for a solution in
>web. All solutions I found need the Microsoft command line tool DevCon,
>which is not very straight forward to use [...]


Also, you are too lazy to figure it out yourself.

It works like a charm for my Kingston thumb drive.

D:\> devcon remove *Kingston*
USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP
\001D92A85EAA5B8B040502A
D&0: Removed
1 device(s) removed.

<-- Windows explorer has the Kingston USB drive letter removed

D:\tmp5\i386> devcon rescan
Scanning for new hardware.
Scanning completed.

<-- Windows explorer has the Kingston USB drive letter
reappeared

Reply With Quote
  #8  
Old 19-01-2009
Mehrdad Mirreza
 
Posts: n/a
Re: Eject and re-detect a usb drive without unplugging it

@Bob (Opinicus): This was a reply to
http://www.eggheadcafe.com/software/...device-wi.aspx
.. I don't know why it appears in this forum! What I needed is what is written
in the subject: "Eject and re-detect a usb drive without unplugging it"

"Opinicus" wrote:

> <Mehrdad Mirreza> wrote in message news:200911615251mubed@web.de...
> >I needed this too for testing a launcher on my USB flash drive.

> Needed what?
>
> --
> Bob
> http://www.kanyak.com
>

Reply With Quote
  #9  
Old 19-01-2009
Mehrdad Mirreza
 
Posts: n/a
Re: Eject and re-detect a usb drive without unplugging it

@Harry: Yes you are right, but I already wrote that I am lazy and my solution
was also for lazy people like me, who don't what to start a command session
and type that letters, but do just some clicks.

I must admit though, that your solution using wildcards has the great
benefit that it doesn't need the Windows Device Manager or nother tools to
get the device ID at all (like proposed by Uwe Sieber in the original thread
http://www.eggheadcafe.com/software/...evice-wi.aspx).
So it can be used to automate the "re-plugging" process using a batch file,
which then reduces the work to a doubleclick.

But I still remain with my solution as the easiest one :)

- MiMe

"Harry" wrote:

> On Jan 15, 10:52 pm, Mehrdad Mirreza wrote:
> On Jan 15, 10:52 pm, Mehrdad Mirreza wrote:
> >I needed this too for testing a launcher on my USB flash drive. As I
> >used an old computer without front USB ports and I was too lazy to stand
> >up each time and replug the memory stick I searched for a solution in
> >web. All solutions I found need the Microsoft command line tool DevCon,
> >which is not very straight forward to use [...]

>
> Also, you are too lazy to figure it out yourself.
>
> It works like a charm for my Kingston thumb drive.
>
> D:\> devcon remove *Kingston*
> USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP
> \001D92A85EAA5B8B040502A
> D&0: Removed
> 1 device(s) removed.
>
> <-- Windows explorer has the Kingston USB drive letter removed
>
> D:\tmp5\i386> devcon rescan
> Scanning for new hardware.
> Scanning completed.
>
> <-- Windows explorer has the Kingston USB drive letter
> reappeared
>
>

Reply With Quote
  #10  
Old 20-01-2009
Engin Tarhan
 
Posts: n/a
Re: Eject and re-detect a usb drive without unplugging it

As you have volunteered to give this pice of mind boggling wisdom without
being asked, I will also volunteer to give a piece of my mind, and I will
not be as gentle as the other fellas who have read your message and just
laughed it off.

You may think that being lazy is a quality to be proud of, but the
information your are giving is potentially dangerous! A number of clicks and
keypresses in a sensitive area of the OS which should be tinkered by people
who know what they're doing is not going to provide any benefit to the
mainstream of the computer users, the "normal" users as opposed to the lazy
one(s).

I believe that this fantastic way of showing your right earlobe with your
left hand will be adopted by no more than a handful of users who like to
think of themselves as being eccentric. If you were as clever as you're
lazy, you'd think of using a USB hub to bring that flash drive near your
hand.

Good luck
Engin

<Mehrdad Mirreza> wrote in message news:200911615251mubed@web.de...
>I needed this too for testing a launcher on my USB flash drive. As I used
>an old computer without front USB ports and I was too lazy to stand up each
>time and replug the memory stick I searched for a solution in web. All
>solutions I found need the Microsoft command line tool DevCon, which is not
>very straight forward to use, so I tried to find another one. It needs also
>some clicks, but does without extra tools:
>
> 1. push [win]+[Pause] to show the "System Properties" dialog or just pick
> it from the Control Panel
>
> 2. switch to Hardware tab and click on "Device Manager"
>
> 3. There you click on "Universal Serial Bus controllers" to open it
>
> 4. Below that you see 5 (maybe more or less) items called "USB root Hub".
> If you know which of them your device is connected to (i.e. through
> experience) right click it and select "disable", otherwise do that with
> all of them. WARNING: doing so will disconnect all connected USB devices!
>
> 5. Right click the disabled items and select "enable". Your devices are
> then detected again.
>
> EggHeadCafe - .NET Developer Portal of Choice
> http://www.eggheadcafe.com/default.aspx?ref=ng



Reply With Quote
  #11  
Old 02-12-2009
saad ali
 
Posts: n/a
qs?

can u plz tell me how to achieve this using a batch file.? thnx nd nice job.



Harry wrote:

Re: Eject and re-detect a usb drive without unplugging it
21-Jan-09

On Jan 15, 10:52=A0pm, Mehrdad Mirreza wrote:
On Jan 15, 10:52 pm, Mehrdad Mirreza wrote:

Also, you are too lazy to figure it out yourself.

It works like a charm for my Kingston thumb drive.

D:\> devcon remove *Kingston*
USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP
\001D92A85EAA5B8B040502A
D&0: Removed
1 device(s) removed.

<-- Windows explorer has the Kingston USB drive letter removed

D:\tmp5\i386> devcon rescan
Scanning for new hardware.
Scanning completed.

<-- Windows explorer has the Kingston USB drive letter
reappeared

Previous Posts In This Thread:

On Sunday, April 08, 2007 4:24 AM
Nand wrote:

Re-detect a USB device without Unplugging and Replugging
synopsis :

Do we have a way to make windows detect a usb device once it is marked for
'safe removal'

Details :

I use windows xp with all latest patches,
i use a usb flash device to exchange data between work and home. Every time
i unplug the usb drive using the system tray icon, the un-mountings of the
usb device happens without any glitches. But i want the device to be
re-detected without a physical removal & plugging. i tried the "Add Hardware"
.. i fails with the below shown message

"Windows cannot use this hardware device because it has been prepared for
'safe removal', but it has not been removed from the computer. (Code 47)

To fix this problem, unplug this device from your computer and then plug it
in again."

though this pretty much explains what i should do,
is there a way to bypass this and re-detect my device.

Thanks

On Sunday, April 08, 2007 10:14 AM
David Vair wrote:

Why would you use the safely remove device if you don't want to remove it?
Why would you use the safely remove device if you don't want to remove it? When you tell Windows
that you want to remove the device the system wil make it so that no information can be written to
it, that way nothing is lost. Only way to get it to be recognized is to remove and reinsert.
--
Dave Vair
CNE, CNA, MCP, A+, N+

"Nanda" <Nanda@discussions.microsoft.com> wrote in message
news:0BCD976E-561E-482D-A24F-0C5042B967FF@microsoft.com...

On Monday, April 09, 2007 7:53 AM
Pavel A. wrote:

Yes it's possible to clear the remove flag and reenumerate the deviceusing
Yes it is possible to clear the remove flag and reenumerate the device
using API, though I cannot remember any ready tool for this.

--PA

On Tuesday, April 10, 2007 3:09 AM
Uwe Sieber wrote:

You could deactivate and then reactivate it instaed my meansof Microsoft
You could deactivate and then reactivate it instaed my means
of Microsoft DEVCON:
http://support.microsoft.com/kb/311272

Samples:
devcon disable USB\VID_067B*PID_2517\6*12115AD4*
devcon enable USB\VID_067B*PID_2517\6*12115AD4*

The device ID you can get by means of my tool
ListUsbDrives which comes with my USBDLM tool:
http://www.uwe-sieber.de/files/usbdlm.zip
Use the 'Ctrl DevID'.

The & character has a special meaning on the XP
commandline, so the best way is to replace it by
asterisks which DEVCON sees as wildcard for 'any char'.


Uwe



Nanda wrote:

On Friday, January 16, 2009 1:52 AM
Mehrdad Mirreza wrote:

Eject and re-detect a usb drive without unplugging it
I needed this too for testing a launcher on my USB flash drive. As I used an old computer without front USB ports and I was too lazy to stand up each time and replug the memory stick I searched for a solution in web. All solutions I found need the Microsoft command line tool DevCon, which is not very straight forward to use, so I tried to find another one. It needs also some clicks, but does without extra tools:

1. push [win]+[Pause] to show the "System Properties" dialog or just pick it from the Control Panel

2. switch to Hardware tab and click on "Device Manager"

3. There you click on "Universal Serial Bus controllers" to open it

4. Below that you see 5 (maybe more or less) items called "USB root Hub". If you know which of them your device is connected to (i.e. through experience) right click it and select "disable", otherwise do that with all of them. WARNING: doing so will disconnect all connected USB devices!

5. Right click the disabled items and select "enable". Your devices are then detected again.

On Friday, January 16, 2009 2:33 AM
Opinicus wrote:

Re: Eject and re-detect a usb drive without unplugging it
Needed what?

--
Bob
http://www.kanyak.com

On Sunday, January 18, 2009 6:38 PM
MehrdadMirrez wrote:

Re: Eject and re-detect a usb drive without unplugging it
@Bob (Opinicus): This was a reply to
http://www.eggheadcafe.com/software/...device-wi.aspx
.. I don't know why it appears in this forum! What I needed is what is written
in the subject: "Eject and re-detect a usb drive without unplugging it"

"Opinicus" wrote:

On Sunday, January 18, 2009 7:28 PM
MehrdadMirrez wrote:

Re: Eject and re-detect a usb drive without unplugging it
@Harry: Yes you are right, but I already wrote that I am lazy and my solution
was also for lazy people like me, who don't what to start a command session
and type that letters, but do just some clicks.

I must admit though, that your solution using wildcards has the great
benefit that it doesn't need the Windows Device Manager or nother tools to
get the device ID at all (like proposed by Uwe Sieber in the original thread
http://www.eggheadcafe.com/software/...evice-wi.aspx).
So it can be used to automate the "re-plugging" process using a batch file,
which then reduces the work to a doubleclick.

But I still remain with my solution as the easiest one :)

- MiMe

"Harry" wrote:

On Tuesday, January 20, 2009 9:27 AM
Engin Tarhan wrote:

As you have volunteered to give this pice of mind boggling wisdom without
As you have volunteered to give this pice of mind boggling wisdom without
being asked, I will also volunteer to give a piece of my mind, and I will
not be as gentle as the other fellas who have read your message and just
laughed it off.

You may think that being lazy is a quality to be proud of, but the
information your are giving is potentially dangerous! A number of clicks and
keypresses in a sensitive area of the OS which should be tinkered by people
who know what they're doing is not going to provide any benefit to the
mainstream of the computer users, the "normal" users as opposed to the lazy
one(s).

I believe that this fantastic way of showing your right earlobe with your
left hand will be adopted by no more than a handful of users who like to
think of themselves as being eccentric. If you were as clever as you're
lazy, you'd think of using a USB hub to bring that flash drive near your
hand.

Good luck
Engin

<Mehrdad Mirreza> wrote in message news:200911615251mubed@web.de...

On Wednesday, January 21, 2009 12:19 AM
Harry wrote:

Re: Eject and re-detect a usb drive without unplugging it
On Jan 15, 10:52=A0pm, Mehrdad Mirreza wrote:
On Jan 15, 10:52 pm, Mehrdad Mirreza wrote:

Also, you are too lazy to figure it out yourself.

It works like a charm for my Kingston thumb drive.

D:\> devcon remove *Kingston*
USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP
\001D92A85EAA5B8B040502A
D&0: Removed
1 device(s) removed.

<-- Windows explorer has the Kingston USB drive letter removed

D:\tmp5\i386> devcon rescan
Scanning for new hardware.
Scanning completed.

<-- Windows explorer has the Kingston USB drive letter
reappeared


Submitted via EggHeadCafe - Software Developer Portal of Choice
The Software Project Loan Shark!
http://www.eggheadcafe.com/tutorials...ject-loan.aspx
Reply With Quote
  #12  
Old 02-12-2009
Bob I
 
Posts: n/a
Re: qs?

Place the lines in a text file and change the extension to .BAT

saad wrote:

> can u plz tell me how to achieve this using a batch file.? thnx nd nice job.
>
>
>
> Harry wrote:
>
> Re: Eject and re-detect a usb drive without unplugging it
> 21-Jan-09
>
> On Jan 15, 10:52=A0pm, Mehrdad Mirreza wrote:
> On Jan 15, 10:52 pm, Mehrdad Mirreza wrote:
>
> Also, you are too lazy to figure it out yourself.
>
> It works like a charm for my Kingston thumb drive.
>
> D:\> devcon remove *Kingston*
> USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP
> \001D92A85EAA5B8B040502A
> D&0: Removed
> 1 device(s) removed.
>
> <-- Windows explorer has the Kingston USB drive letter removed
>
> D:\tmp5\i386> devcon rescan
> Scanning for new hardware.
> Scanning completed.
>
> <-- Windows explorer has the Kingston USB drive letter
> reappeared
>
> Previous Posts In This Thread:
>
> On Sunday, April 08, 2007 4:24 AM
> Nand wrote:
>
> Re-detect a USB device without Unplugging and Replugging
> synopsis :
>
> Do we have a way to make windows detect a usb device once it is marked for
> 'safe removal'
>
> Details :
>
> I use windows xp with all latest patches,
> i use a usb flash device to exchange data between work and home. Every time
> i unplug the usb drive using the system tray icon, the un-mountings of the
> usb device happens without any glitches. But i want the device to be
> re-detected without a physical removal & plugging. i tried the "Add Hardware"
> . i fails with the below shown message
>
> "Windows cannot use this hardware device because it has been prepared for
> 'safe removal', but it has not been removed from the computer. (Code 47)
>
> To fix this problem, unplug this device from your computer and then plug it
> in again."
>
> though this pretty much explains what i should do,
> is there a way to bypass this and re-detect my device.
>
> Thanks
>
> On Sunday, April 08, 2007 10:14 AM
> David Vair wrote:
>
> Why would you use the safely remove device if you don't want to remove it?
> Why would you use the safely remove device if you don't want to remove it? When you tell Windows
> that you want to remove the device the system wil make it so that no information can be written to
> it, that way nothing is lost. Only way to get it to be recognized is to remove and reinsert.


Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows XP > XP Hardware


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Re-detect a USB device without Unplugging and Replugging"
Thread Thread Starter Forum Replies Last Post
PC does not detect any USB mass storage device Quique Portable Devices 5 21-12-2009 09:42 PM
BSOD after unplugging USB device roy838 Vista Help 10 07-09-2009 02:18 AM
Unable to detect DVD device Darryl Von Rokk Vista Hardware Devices 5 06-07-2009 06:06 PM
NT Backup does not detect my tape device SBS Golfer Small Business Server 8 27-01-2009 10:36 PM
Nokia pc suite can't detect my bluetooth device Eiman Vista Help 0 21-01-2008 08:23 PM


All times are GMT +5.5. The time now is 08:31 AM.