Floppy support in Windows Virtual PC 7

Windows Virtual PC 7 is the successor to Virtual PC 2007, and the only version of Virtual PC that can run on Windows 7. It's freely available to anyone, and if you have Windows 7 Professional or Ultimate, you can also download Windows XP Mode, a virtual machine of Windows XP that allows you to run applications that may not otherwise work on Windows 7.

It seems however that Microsoft has removed the UI for using floppy disks with Windows Virtual PC 7. It was there in Virtual PC 2007, and now it's not. However, here's the thing: they only removed the UI, not the functionality itself.

The functionality for using floppy disks is still available in Windows Virtual PC 7, but it's only accessible via the COM object, which is not very convenient. Fortunately, Windows 7 also includes PowerShell, a very powerful shell scripting environment, that allows us to make things a bit easier.

Below, I present three PowerShell scripts: one to create virtual floppy disk images, one to attach floppy disks to a VM, and one to release them. The latter two can be used with both virtual floppy disk images, or a real floppy drive on the host computer.

You can download all three scripts here. Or you can just copy/paste them into a file, whichever you prefer. Note that you'll need to configure PowerShell to allow unsigned scripts to run, or sign the scripts.

Anyway, here are the scripts:

Create-VirtualFloppy.ps1:

param(
    [parameter(Position=0, Mandatory=$true)][string]$Path
)

$vpc = New-Object -ComObject "VirtualPC.Application"
if( -not [System.IO.Path]::IsPathRooted($Path) )
{
    # CreateFloppyDiskImage requires an absolute path
    [Environment]::CurrentDirectory = (Get-Location -PSProvider FileSystem).ProviderPath
    $Path = [System.IO.Path]::GetFullPath($Path)
}
$vpc.CreateFloppyDiskImage($Path, 2)

Attach-VirtualFloppy.ps1:

param(
  [parameter(Position=0, Mandatory=$true)][string]$VirtualMachineName,
  [parameter(Position=1, Mandatory=$true)][string]$FloppyPath,
  [parameter(Mandatory=$false)][Switch]$HostDrive
)

$vpc = New-Object -ComObject "VirtualPC.Application"
$vm = $vpc.FindVirtualMachine($VirtualMachineName)

if( $vm -eq $null )
{
    Write-Error "Virtual machine $vm not found."
}
else
{
    if( $HostDrive )
    {
        $vm.FloppyDrives.Item(1).AttachHostDrive($FloppyPath)
    }
    else
    {
        if( -not [System.IO.Path]::IsPathRooted($FloppyPath) )
        {
            # AttachImage requires an absolute path
            [Environment]::CurrentDirectory = (Get-Location -PSProvider FileSystem).ProviderPath
            $FloppyPath = [System.IO.Path]::GetFullPath($FloppyPath)
        }
        $vm.FloppyDrives.Item(1).AttachImage($FloppyPath)
    }
}

Release-VirtualFloppy.ps1:

param(
  [parameter(Position=0, Mandatory=$true)][string]$VirtualMachineName
)

$vpc = New-Object -ComObject "VirtualPC.Application"
$vm = $vpc.FindVirtualMachine($VirtualMachineName)

if( $vm -eq $null )
{
    Write-Error "Virtual machine not found."
}
else
{
    if( $vm.FloppyDrives.Item(1).ImageFile -ne $null )
    {
        $vm.FloppyDrives.Item(1).ReleaseImage()
    }
    elseif( $vm.FloppyDrives.Item(1).HostDriveLetter -ne $null )
    {
        $vm.FloppyDrives.Item(1).ReleaseHostDrive()
    }
    else
    {
        Write-Warning "No virtual floppy is attached to the virtual machine $VirtualMachineName."
    }
}

Using the scripts is pretty simple. Run PowerShell, navigate to the directory where you put the scripts, and invoke them. Remember that you need to enable execution of unsigned scripts (Set-ExecutionPolicy RemoteSigned), or sign the scripts.

The following example creates a virtual floppy drive image called sample.vfd, attaches it to the Windows XP Mode virtual machine, and then releases it again:

.\Create-VirtualFloppy.ps1 sample.vfd
.\Attach-VirtualFloppy.ps1 "Windows XP Mode" sample.vfd
.\Release-VirtualFloppy.ps1 "Windows XP Mode"

Please note that the virtual machine must be running for attach and release to work.

The following example attaches the host floppy drive A and then releases it again:

.\Attach-VirtualFloppy.ps1 "Windows XP Mode" A -HostDrive
.\Release-VirtualFloppy.ps1 "Windows XP Mode"

And that's it! Now you can use floppy disks with Windows Virtual PC 7 once again.

Categories: General computing
Posted on: 2010-10-17 06:20 UTC.

Comments

John

2011-02-14 20:00 UTC

GREAT post about this. THANK YOU very much. I have been struggling with this change and you have solved my issue! Best of luck in your PHD!

Dennis

2012-04-10 01:36 UTC

I'll second the bit about this being a great post. I'm not sure why it didn't work at first, but after attaching my physical floppy to the virtual xp machine I had to shut down the XP machine and restart it to see the floppy data.
Excellent - and thanks!

Medinoc

2012-05-23 09:57 UTC

Hello,
This comment is about the Uryuomoco translator, since I have no idea how to "let [you] know on [your] blog" otherwise.

My point is that since anticarrot.com fell to cybersquatters, you may want to put the translation rules on a web page in your own site.

PS: You may also want to add on the comment form the fact that the CAPTCHA requires cookies.

buy female viagra

2013-11-04 17:48 UTC

all the time i used to read smaller content that also clear
their motive, and that is also happening with this post which I am reading at this place.

buy topamax online from UK

2013-11-19 03:42 UTC

Great article.

get viagra online

2013-12-15 10:17 UTC

Thanks for your marvelous posting! I really enjoyed reading
it, you will be a great author. I will ensure that I bookmark your blog and will come back very soon.
I want to encourage yourself to continue your great work, have a nice day!

acheter vardenafil au meilleur prix

2013-12-25 16:04 UTC

Hello, I log on to your blogs like every week.

Your writing style is witty, keep up the good work!

cialis australia to buy

2013-12-30 09:10 UTC

Thanks for your personal marvelous posting! I really enjoyed reading it, you're a great author.I will make certain to bookmark your blog and
definitely will come back later in life. I want to encourage you to continue your great job, have a nice morning!

generic cialis

2014-01-13 23:22 UTC

My programmer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses. But he's tryiong none the less.
I've been using Movable-type on a number of websites for about a year
and am nervous about switching to another platform. I have heard excellent things about blogengine.net.
Is there a way I can transfer all my wordpress content
into it? Any kind of help would be greatly appreciated!

http://www.eastvillagearts.org/

2014-01-19 10:38 UTC

WOW just what I was looking for. Came here by searching for the

voyance gratuite en ligne

2014-02-23 15:30 UTC

L internaute magazine sylvie voyance

how to use apple cider vinegar for acne

2014-02-24 04:20 UTC

I actually really like the theme on your website, I run
a site, and i would enjoy to make use of this theme.

oldschoolnewbodypdf2014.blogspot.com

2014-02-25 04:08 UTC

So ոow thаt you realize that radical changes are going to
be takіng place, let's get to the meat of the situation.
To figսre out your fluid requiremeոts, just weigh your self naked
prior to and jսst after аn hour of difficult woгkout duriոg which you sipped nothing.
It truly is difficսlt mainly because carrying on typical day-to-day
activitieѕ demand using mouth every now and then for numerouѕ causes.

rifle scope reviews

2014-02-27 15:05 UTC

Whats up are using Wordpress for your site platform?

I'm new to the blog world but I'm trying to get started and set up my
own. Do you require any html coding knowledge to make your own blog?
Any help would be really appreciated!

http://www.curtainconcepts.biz

2014-03-01 13:28 UTC

Hi there, You've done an excellent job. I'll certainly digg
it and personally suggest to my friends. I'm sure they will be benefited from this site.

mobilselskaber

2014-03-02 05:28 UTC

I was suggested this website by my cousin. I am not
sure whether this post is written by him as no one else know such detailed about my trouble.
You're incredible! Thanks!

a-kasse

2014-03-02 07:01 UTC

Have you ever thought about including a little bit more than just your articles?
I mean, what you say is fundamental and all. Nevertheless imagine if you added some great pictures or videos to give your posts more,
"pop"! Your content is excellent but with pics and videos, this blog could definitely be one of the greatest
in its niche. Very good blog!

a kassen

2014-03-02 18:37 UTC

Thanks for ones marvelous posting! I seriously enjoyed reading it, you could be a great author.

I will make sure to bookmark your blog and will often come back from
now on. I want to encourage you continue your great work, have a nice
weekend!

voyance

2014-03-06 11:08 UTC

Horoscope centre michele perras horoscope gratuit du verseau

billige mobilabonnementer

2014-03-08 08:54 UTC

Howdy! I could have sworn I've been to this site before but after going through a few
of the posts I realized it's new to me. Nonetheless, I'm certainly happy I came across
it and I'll be book-marking it and checking back frequently!

Respark The Romance free

2014-03-08 15:51 UTC

Ϻost readers are able to relate to this more because
it dealѕ with their present world. Everүone comments on costսmes, it is the nature of
the hоliday and you wеar your costume on your Ьody.
According to some tips I came ɑcross on the Internet, you can show гomance through your mouth, what ʏou
write and so on.

pregnancy miracle pdf

2014-03-11 03:11 UTC

Is there any sіgn or symptoms to indіcate
that you suffeг from endometriosis or polycystic
ovarian syndrome. At this stage your egg (ovum) is ready to meet thе ѡіnning
spermatozoa of youг spоսse and gets fertiliƶed. You
can also traсk ovulation by taкіng the woman'ѕ each day basal Һuman bodу temperature just about every early morning.

a-kasser i danmark

2014-03-16 02:23 UTC

There's definately a lot to know about this topic.
I like all the points you've made.

taxes Paycheck calculator

2014-05-14 05:25 UTC

I love үour bloǥ.. very nice colοrs & theme. Did you design this website youгself
or did you hire somеone to do it for you? Plz respond as I'm
looking to constrսct my own blog and would like to find out where
u got this from. thanks a lot

Smithk819

2014-05-26 12:31 UTC

Farmville farms even include free gift that is especially designed for the neighbors on their farm visit. feffecdkbbfefkfe

Pharmk28

2014-05-27 10:26 UTC

Very nice site! [url=http://aixopey2.com/qqsrqt/2.html]cheap goods[/url]

Pharme373

2014-05-27 10:28 UTC

Very nice site! cheap goods http://aixopey2.com/qqsrqt/4.html

Pharmb952

2014-05-27 10:28 UTC

Very nice site!

www.youtube.com

2014-07-08 09:54 UTC

This is the fact that their relationship has improved no end.
Clearly, a number of professionals confused with wrongful death cases.
So, that's the value that we can get me at davidlesch@bronxnet.
We ended up trying that case out to be sure that she originally medical attorney went to school.

cialis price

2014-07-21 14:38 UTC

Hello There. I found your blog using msn. This is an extremely well written article.
I'll be sure to bookmark it and return to read more of your
useful information. Thanks for the post. I'll certainly return.

Owen

2014-07-21 16:41 UTC

This website certainly has all of the information and
facts I needed about this subject and didn't know whoo to ask.

cialis

2014-07-23 23:04 UTC

It's hard to come by knowledgeable people for this topic,
but you sound like you know what you're talking about!

Thanks

buy cialis

2014-07-25 17:41 UTC

With havin so much content and articles do you ever run into any problems of plagorism or copyright violation?
My website has a lot of completely unique content I've either
authored myself or outsourced but it appears a lot of it is popping it
up all over the internet without my authorization. Do you know any methods to help prevent content from being ripped off?

I'd truly appreciate it.

chevy silverado performance

2014-07-29 06:29 UTC

Good ԁay! I was interested to know if setting up a wеblog sucɦ
your own: http://www.ookii.org/Blog/floppy_support_in_windows_virtual_pc_7 is tough to
do for սnskilled people? I have been wanting to set up my ߋwn website for a ԝhile now but have been turned off mainly because I've always believed it required tons of
work. Ԝhat do you think? Кudos

Add comment

Latest posts

Categories

Archive

Syndication

RSS Subscribe