Automatically Attach USB Device When Using XP Mode Applications

18,354

Solution 1

No it is not currently possible, though you can right-click on the Windows 7 Taskbar Icon for the running program and under "Tasks" you can select "Manage USB Devices". That way you don't have to fully open then XP virtual machine and still attach and remove devices.

While I wish we could set it for automatic, I have yet to find a way!

Solution 2

Use a Power Shell Script simular like this one (Adapt to your own needs and save to C:\XPmode-USB.PS1):

& 'C:\Users\%username%\Virtual Machines\Windows XP Mode.vmcx'
Start-Sleep -s 10
$vpc = new-object -com VirtualPC.Application
$vmName = "Windows XP Mode"
$vm = $vpc.findVirtualMachine($vmName)
$usb = "GW-USNANO"
$usbDevice = $vpc.USBDeviceCollection | ? {$_.DeviceString -eq $usb} | select -first 1
$vm.AttachUSBDevice($usbDevice)

Create a Batch file containing:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe c:\XPmode-USB.PS1

Create a link anywhere you like!

(Thanks to http://blogs.msdn.com/b/virtual_pc_guy/archive/2011/01/18/script-to-attach-a-usb-device-to-a-virtual-machine-vpc.aspx and How to start a virtual machine via a scheduled task?)

Solution 3

Open the desired XP mode program from Windows 7. (The program must already be installed in XP mode.)

Once open, right click on the task icon in the task bar.

Then a Manage USB Devices window opens where you can attach the desired USB devices.

This allows for USB devices to be attached without starting the whole virtual desktop.

Share:
18,354

Related videos on Youtube

Chemary
Author by

Chemary

I currently spend time during the day working for biBERK, a Berkshire Hathaway Insurance Company. In my spare time, I help plan Techbash, a developer conference in the Northeastern US.

Updated on September 17, 2022

Comments

  • Chemary
    Chemary almost 2 years

    When using XP Mode in Windows 7, you can attach a USB device. Is there anyway to automatically attach a USB device when running an application in XP Mode? For instance, a USB Printer?

    • Admin
      Admin over 12 years
      This is not availvable in windows 7 unlitmate, so i dont know what you are on a bout...there is nothing like "Manage USB Devices" when you right click the task bar all you get is start task manager and lock task bar amongst other unrelated stuff from the context menu...so unless you are sure of what you are saying can you be more specific where exactly you saw it ????
  • nixda
    nixda over 11 years
    My experience with XP Mode was that it doesn't remember these attached devices after a restart. Has this been changed since the last year?