Networknet archive Blog

Windows Virtual PC: Attach a virtual floppy disk

Originally published Last updated 5 comments

Windows Virtual PC does not show an option to add a virtual floppy drive in its graphical interface. It can still attach and use VFD files, but you need to use the Command Prompt. The settings for my “Windows XP Mode” virtual machine show no floppy-drive option.

image

Attach the VFD file

Microsoft provided a script for attaching a VFD file. You need to create the VFD file before attaching it.

Download the Floppy Drive Scripts.zip script package.

C:\Scripts\vm>cscript FloppyDrive.vbs

Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation.
All rights reserved. Missing command-line argument

Usage: FloppyDrive.vbs /vm:"Name of virtual machine to be started"                       
            /action: info       - to display information about the current floppy configuration                               
                       disconnect - to disconnect any attached floppy disk or floppy disk image                               
                       vfd        - to attach a virtual floppy disk image                               
                       physical   - to attach a physical floppy disk                       
           /floppy:name       - where name is either the full name and path for a virtual floppy disk or the letter of a physical disk to attach

Running FloppyDrive.vbs shows an action for attaching a VFD file. When I supplied the parameters, I received the following error:

Code1 line
1
cscript FloppyDrive.vbs /vm:"Windows XP Mode" /action:vfd /floppy:"C:\mklinks\floppy.vfd"
Code1 line
1
Attaching C:\mklinks\floppy.vfd to the floppy drive. C:\Scripts\vm\FloppyDrive.vbs(113, 3) (null): The system cannot find the file specified

The script did not create the VFD file, so I installed WinImage.

image

Create a new file in WinImage and save it as floppy.vfd. I then ran FloppyDrive.vbs again, and the file was attached.

image

Check the virtual machine configuration

The VMC file now shows the virtual floppy in the configuration. You can also add this configuration manually to perform the same action as the VBScript.

Code1 line
1
<floppy id="0">             <pathname>                 <absolute type="string">C:\mklinks\floppy.vfd</absolute>                 <relative type="string">..\..\..\..\..\..\..\mklinks\floppy.vfd</relative>             </pathname>         </floppy>

5 comments

Comments from the original WordPress site, kept read-only.

  1. Eduardo Werley

    Hi, dude, I've followed all steps, but the driver created is Write-Protected. How to solve this? I'm running a Windows 7 professional 64-bits in XP mode. Thank you.

  2. Eduardo Werley

    Dear Ivan Versluis, thanks for replying.

    I have managed to solve the write-protection issue. This was due to Windows 7 write permissions in the root folder, where I've put the vfd file. When I moved that file to My documents folder, it worked.

    Regards.


    Ivan Versluis:

    Hey Eduardo,
    Can you send me an email with the screenshot you are getting?

  3. Brian

    I get errors running bot scripts:

    You cannot call a method on a null-valued expression.
    At E:\Apps\Virtual_Machine_Additions\Floppy_Drive_Scripts\FloppyDrive.ps1:40 char:39
    + $vmFloppyDrive = $vm.FloppyDrives.item <<<< (1)
    + CategoryInfo : InvalidOperation: (item:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull