cdorobantu Posted November 30, 2006 Posted November 30, 2006 Hi, I have made an AutoIt script that can detect a USB external HDD in WinPE, check its size and compare it to the internal HDD. If the external has less than the internal one, then the external disk will be formatted. The problem that WinPE only detects the USB drive if I boot the computer with the drive connected. If I am already in WinPE and I plug in the USB drive then nothing happens. Does anyone know how I can ask WinPE to scan through the USB ports and find the drive using an AutoIt script? I do not want to have to reboot every time I connect a USB drive to the computer because this runs from a CD so it takes a while. Thanks.
AzKay Posted November 30, 2006 Posted November 30, 2006 Whats WinPE? Windows Personal Edition? Oo # MY LOVE FOR YOU... IS LIKE A TRUCK- #
cdorobantu Posted November 30, 2006 Author Posted November 30, 2006 (edited) Whats WinPE? Windows Personal Edition? OoNo, it is Windows Preinstallation Environment. It is a stripped down version of Windows that in my case, is based on Windows XP SP2. It is Microsoft's version of BartPE. Edited November 30, 2006 by cdorobantu
Danny35d Posted November 30, 2006 Posted November 30, 2006 You will need DevCon command line from M$.DevCon rescan With the rescan switch it will check for new plug and play devices, as long you have the drivers included on WinPe.Go to this link to download DevCon AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
cdorobantu Posted November 30, 2006 Author Posted November 30, 2006 Thanks Danny35d, I will give this a try and post my results.
Danny35d Posted November 30, 2006 Posted November 30, 2006 (edited) Thanks Danny35d, I will give this a try and post my results.Your welcome. I know some WinPe user hate BartPe, but if you create your WinPe using Bart program you can also use BartPe.exe -pnp and it will do the same thing as DevCon. Edited November 30, 2006 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
cdorobantu Posted November 30, 2006 Author Posted November 30, 2006 Danny35d, I have tried the DevCon rescan command plus other alternatives of the same thing and no luck. I still need to reboot in order for WinPE to pick up the external driver. Maybe there is no way; it's just that it would be nice if the USB storaged worked in PE the same way it works in Windows XP. Would you know what the differences could be?
Danny35d Posted November 30, 2006 Posted November 30, 2006 Danny35d, I have tried the DevCon rescan command plus other alternatives of the same thing and no luck. I still need to reboot in order for WinPE to pick up the external driver.Maybe there is no way; it's just that it would be nice if the USB storaged worked in PE the same way it works in Windows XP.Would you know what the differences could be?Sorry I haven't do this in along time, I forgot to mention the once you finish running DevCon rescan you need to use Diskpart and assing a drive letter to the usb hard disk. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
cdorobantu Posted December 1, 2006 Author Posted December 1, 2006 @Danny35d, How do I use the Diskpart tool? Do you know the command line to re-mount the drive and assign a drive letter? Thanks a lot!
CyberSlug Posted December 2, 2006 Posted December 2, 2006 Also check out http://www.911cd.net/forums/For listing USB devices, I perfer http://www.jsifaq.com/SF/Tips/Tip.aspx?id=8496DiskPart http://support.microsoft.com/kb/300415I can tell you right now that scripting DiskPart is annoying... http://www.autoitscript.com/forum/index.ph...amp;hl=diskpartHowever, once you get a drive letter, it should work. (Well, I use BartPE with a plugin that enables the diskmgmt.msc GUI and the drive works after the letter is assigned.) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
cdorobantu Posted December 4, 2006 Author Posted December 4, 2006 Also check out http://www.911cd.net/forums/For listing USB devices, I perfer http://www.jsifaq.com/SF/Tips/Tip.aspx?id=8496DiskPart http://support.microsoft.com/kb/300415I can tell you right now that scripting DiskPart is annoying... http://www.autoitscript.com/forum/index.ph...amp;hl=diskpartHowever, once you get a drive letter, it should work. (Well, I use BartPE with a plugin that enables the diskmgmt.msc GUI and the drive works after the letter is assigned.)Thanks for your reply.If I run a disk list in WinPE, I do not get the USB drive listed unless I reboot the machine with the USB drive already connected. I want to be able to reconnect the USB device without restarting the computer. Any suggestions on that?
Danny35d Posted December 4, 2006 Posted December 4, 2006 (edited) I don't have my WinPe CD here at work. I use my other cd build with BartPe. This is an easy way to do it.Steps:1) Open CMD or Command Prompt window.2) Type Diskpart3) At DISKPART> prompt comes out type automountyou will get a message saying "Automatic mounting of new volumes enabled."4) Type Exit, to get out of diskpart.5) Plug in usb hard disk or Thumbdrive6)Type Bartpe -pnp or DevCon rescan7) Open your fle manager (A43, FreeCommander, Explorer, etc.) and you will see the usb drive.Note:You can use diskpart in a batch file and everytime WinPe or Bartpe boot up it will enable automatic mounting of new volumes.You can add the following line to WinPe (Startnet.cmd) or Bartpe (Autorun*_Diskpart.cmd)Diskpart /s %WinDir%\System32\Diskpart.txtCreate a text file, called Diskpart.txt and add the following lines. Copy this file to I386\System32 folder.automountexitEdit:After posting and playing around with diskpart, found out once enabling automatic mounting you don't need Devcon.exe or Bartpe.exe Edited December 4, 2006 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Danny35d Posted December 4, 2006 Posted December 4, 2006 (edited) All the preview post test were done using a Thumb drive or memory stick. I borrow my friend usd hard disk and apply the same steps from the preview post and didn't work.Do the step 1 to 3 and then:4) Plug in usb hard disk or Thumbdrive5) Type List VolumeIt will display a list with all the volume. Look at the one without a Drive Letter (second column).6) Type Select Volume #Where # is the volume number of the missing drive letter.7) Type Assign8) Type again Select Volume #It will display a list with all the volume. Look for the drive letter.9) Type Exit Edited December 4, 2006 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
cdorobantu Posted December 4, 2006 Author Posted December 4, 2006 @Danny35d, I tried following your instructions, but everytime I type the automount command, I just get a listing of what diskpart could do (same list as if I was typing HELP). Do you know why? I was reading on the MS website and they were saying to use the diskpart automount enable command; but that does not work either? Does the diskpart version in XP not have this option? Thanks
Danny35d Posted December 4, 2006 Posted December 4, 2006 (edited) You are right. My BartPe is build with Windows 2003 Server. Diskpart from windows xp doesn't have automount. Edited December 4, 2006 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
cdorobantu Posted December 4, 2006 Author Posted December 4, 2006 Danny35d, I just tried what you posted in WinPE and it does not list the volume. The only two options that I get when I type LIST VOLUME are: Volume 0 (the CD-ROM) and Volume 1 (the internal HDD). The external USB drive is not listed.
cdorobantu Posted December 4, 2006 Author Posted December 4, 2006 You are right. My BartPe is build with Windows 2003 Server.Maybe, if I build my WinPE with the same then it might work... I'm not sure that I can though...Thanks for all your help!
Danny35d Posted December 4, 2006 Posted December 4, 2006 a work around for diskpart automount will be:3) Type Bartpe -pnp or DevCon rescan AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
le15 Posted December 4, 2006 Posted December 4, 2006 Hi,I have made an AutoIt script that can detect a USB external HDD in WinPE, check its size and compare it to the internal HDD. If the external has less than the internal one, then the external disk will be formatted.The problem that WinPE only detects the USB drive if I boot the computer with the drive connected. If I am already in WinPE and I plug in the USB drive then nothing happens.Does anyone know how I can ask WinPE to scan through the USB ports and find the drive using an AutoIt script? I do not want to have to reboot every time I connect a USB drive to the computer because this runs from a CD so it takes a while.Thanks.Try with WinBuilderwww.boot-land.net
cdorobantu Posted December 5, 2006 Author Posted December 5, 2006 Try with WinBuilderwww.boot-land.netIs WinBuilder not a OS on its own? Same as BartPE? How would I use this?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now