Windows Vitual PC で フロッピーディスクをマウントする方法

http://blogs.msdn.com/b/virtual_pc_guy/archive/2009/10/01/using-floppy-disks-with-windows-virtual-pc.aspx

のコンテンツのコピー。これで、Windows 7のVirtual PCでも、フロッピーディスクやフロッピーのイメージをマウントできます。ブートもできるので、DOS環境の作成も可能。

 

Most users of Windows Virtual PC do not need to use floppy disks with their virtual machines, as general usage of floppy disks has become rarer and rarer.  Those who do need to use floppy disks – may think that they can no longer do this – as there is no user interface for connecting floppy disks to virtual machines.

Do not be fooled.

Windows Virtual PC does support the use of floppy disks – but as this feature is only used by a small subset of users – we did not expose this in the user interface.  To use floppy disks you need to have a script to help you.  And here are the scripts:

VBScript:

Option Explicit
 
' Define constants for floppy drive attachment types
CONST vmFloppyDrive_None = 0
CONST vmFloppyDrive_Image = 1
CONST vmFloppyDrive_HostDrive = 2
 
Dim namedArguments, argumentError, vpc, vm, vmName, action, floppy, vmFloppyDrive
 
' Check that the script is running at the command line.
If UCase(Right(Wscript.FullName, 11)) = "WSCRIPT.EXE" Then
 WScript.Echo "This script must be run under CScript."
 WScript.Quit
End If
 
' Get the virtual machine name / floppy commands from the command-line arguments
Set namedArguments = WScript.Arguments.Named
 
argumentError = false
 
If namedArguments.Exists("vm") Then
 vmName = namedArguments.Item("vm")
Else
 argumentError = true
End If
 
If namedArguments.Exists("action") Then
 action = namedArguments.Item("action")
Else
 argumentError = true
End If
 
If namedArguments.Exists("floppy") Then
 floppy = namedArguments.Item("floppy")
Else
 If (not ((action = "info") or (action = "disconnect"))) Then
  argumentError = true
 End If
End If
 
' Display usage information if wrong arguments are provided
if argumentError then
 WScript.Echo "Missing command-line argument"
 WScript.Echo
 WScript.Echo "Usage: FloppyDrive.vbs /vm:" & chr(34) & "Name of virtual machine to be started" & chr(34)
 WScript.Echo
 WScript.Echo "                       /action:info       - to display information about the current floppy configuration"
 WScript.Echo "                               disconnect - to disconnect any attached floppy disk or floppy disk image"
 WScript.Echo "                               vfd        - to attach a virtual floppy disk image"
 WScript.Echo "                               physical   - to attach a physical floppy disk"
 WScript.Echo
 WScript.Echo "                       /floppy:name       - where name is either the full name and path for a virtual"
 WScript.Echo "                                            floppy disk or the letter of a physical disk to attach"
 WScript.Echo
 WScript.Quit
end if
 
' Attempt to connect to Virtual PC
On Error Resume Next
Set vpc = CreateObject("VirtualPC.Application")
If Err.Number <> 0 Then
 WScript.Echo "Unable to connect to Virtual PC."
 WScript.Quit
End if
On Error Goto 0
 
' Get virtual machine object
Set vm = vpc.FindVirtualMachine(vmName)
 
' Get the floppy drive
set vmFloppyDrive = vm.FloppyDrives.item(1)
 
' Perform the specified action
Select Case action
 
 ' Display floppy disk information
 case "info"
  wscript.echo "Floppy disk information"
  wscript.echo "======================="
 
  ' Different information is needed for each attachment type
  select case vmFloppyDrive.Attachment
   case vmFloppyDrive_None 
    wscript.echo "Floppy Attachment : No floppy disk attached"
    wscript.echo "Drive Number      : " & vmFloppyDrive.DriveNumber
   case vmFloppyDrive_Image 
    wscript.echo "Floppy Attachment : Floppy disk image attached"
    wscript.echo "Drive Number      : " & vmFloppyDrive.DriveNumber
    wscript.echo "Image File        : " & vmFloppyDrive.ImageFile 
   case vmFloppyDrive_HostDrive 
    wscript.echo "Floppy Attachment : Physical floppy disk attached"
    wscript.echo "Drive Number      : " & vmFloppyDrive.DriveNumber
    wscript.echo "Host Drive Letter : " & vmFloppyDrive.HostDriveLetter 
  end select
 
 ' Disconnect the current floppy disk
 case "disconnect"
 
  wscript.echo "Disconnecting the floppy disk."
 
  ' A different method is used to disconnect a floppy disk image than for a physical disk 
  select case vmFloppyDrive.Attachment
   case vmFloppyDrive_Image 
    vmFloppyDrive.ReleaseImage
   case vmFloppyDrive_HostDrive 
    vmFloppyDrive.ReleaseHostDrive
  end select
 
 ' Attach a floppy disk image
 case "vfd"
 
  wscript.echo "Attaching " & floppy & " to the floppy drive."
  vmFloppyDrive.AttachImage(floppy)
 
 ' Attach a physical floppy disk
 case "physical&q
uot;
 
  wscript.echo "Attaching physical disk " & floppy & ": to the floppy drive."
  vmFloppyDrive.AttachHostDrive(floppy)
 
 ' Catch invalid actions
 case else
  wscript.echo "Invalid action provided. Info, disconnect, vfd and physical are valid options."
 
end select
 
wscript.echo

PowerShell:

param([string]$vmName, [string]$action, [string]$floppy)
 
$argumentError = 0
 
# Check for correct command-line arguments
If ($vmName -eq "")
 {$argumentError = 1}
 
If ($action -eq "")
 {$argumentError = 1}
 
If ($floppy -eq "")
 {
  if ((!([string]::Compare($action, "vfd", $True))) -or (!([string]::Compare($action, "physical", $True))))
  {$argumentError = 1}
 }
 
# Display usage information if wrong arguments are provided
If ($argumentError -eq 1)
 {
 write-host "Missing command-line argument."
 write-host "USage: FloppyDrive.ps1 -vmName `"Name of virtual machine`""
 write-host "                       -action info       - to display information about the current floppy configuration"
 write-host "                               disconnect - to disconnect any attached floppy disk or floppy disk image"
 write-host "                               vfd        - to attach a virtual floppy disk image"
 write-host "                               physical   - to attach a physical floppy disk"
 write-host
 write-host "                       -floppy name       - where name is either the full name and path for a virtual"
 write-host "                                            floppy disk or the letter of a physical disk to attach"
 exit
 }
 
# Connect to Virtual PC
$vpc=new-object –com VirtualPC.Application –Strict
 
# Get virtual machine object
$vm = $vpc.FindVirtualMachine($vmName)
 
# Get the floppy drive
$vmFloppyDrive = $vm.FloppyDrives.item(1)
 
# Perform the specified action
switch ($action) 
   {
 
   # Display floppy disk information
   "info" {
      write-host "Floppy disk information"
      write-host "======================="
 
      # Different information is needed for each attachment type
      switch ($vmFloppyDrive.Attachment)
        {
        0 {
           write-host "Floppy Attachment : No floppy disk attached"
           write-host "Drive Number      : " $vmFloppyDrive.DriveNumber}
        1 { 
           write-host "Floppy Attachment : Floppy disk image attached"
           write-host "Drive Number      : " $vmFloppyDrive.DriveNumber
           write-host "Image File        : " $vmFloppyDrive.ImageFile }
        2 { 
           write-host "Floppy Attachment : Physical floppy disk attached"
           write-host "Drive Number      : " $vmFloppyDrive.DriveNumber
           write-host "Host Drive Letter : " $vmFloppyDrive.HostDriveLetter }
        }
      }
 
   # Disconnect the current floppy disk
   "disconnect" {
 
      write-host "Disconnecting the floppy disk."
 
      # A different method is used to disconnect a floppy disk image than for a physical disk 
      switch ($vmFloppyDrive.Attachment)
         {
         1 {$vmFloppyDrive.ReleaseImage()}
         2 {$vmFloppyDrive.ReleaseHostDrive()}
         }
      }
 
   # Attach a floppy disk image
   "vfd" {
      write-host "Attaching " $floppy " to the floppy drive."
      $vmFloppyDrive.AttachImage($floppy)
      }
      
   # Attach a physical floppy disk
   "physical"  {
      write-host "Attaching physical disk " $floppy ": to the floppy drive."
      $vmFloppyDrive.AttachHostDrive($floppy)
      }
      
   # Catch invalid actions
   default {write-host "Invalid action provided. Info, disconnect, vfd and physical are valid options."}
   }

These scripts are fairly “self documenting” and will provide error messages if the wrong input is provided.  They will allow you to connect both physical and virtual floppy disks to a virtual machine.  As well as to check the information about the current floppy disk configuration.

I have also attached these scripts for download.

Cheers,

Ben

ビットロッカー(Bitlocker)のあれこれ

Windows 7の上位エディションに強力な機能の一つの、Bitlocker。

企業でノートPC導入している場合、Bitlockerは絶対必須。Bitlockerをかえけておけば、個人情報がはいったノートPCを紛失したとしても、データが吸い上げられてしまうことは無い(おそらく)。

しかし、その強力なセキュリティ機能ゆえ、落とし穴もある。Bitlockerを使っていてハマる事と、(あれば)その解決法。

ドッキングステーションを使ってる場合や、外付けドライブ(HDD・DVD問わず)を使っている場合

ドッキングステーションや外付けドライブを使っているときは、かなり注意が必要。それらを外して外出先で利用しようとするとハードウェアプロファイルが変わってしまっているので起動できなくなる。

ドッキングステーションや外付けドライブを使ってい場合は、外で利用する状況、つまりは、それれを外した状態でBitlockerをかける。その際に、プロファイルのバックアップファイルをUSBドライブにも作成しておく。

このタイミングでないとUSBドライブにバックアップファイルを作れないので注意。

BIOSアップデート

意外とハマる。特に、最新状況を保ちたいと思う、ハードウェアGeekにはありがちな落とし穴。BIOSアップデートすると、当然、ハードウェアプロファイルが変わったと認識されるので、起動できなくなる。

BIOSアップデートの際は、事前にBitlockerを解除しておかなければならない。(と思われる)。もしかすると、Bitlockerをsuspendしておくと大丈夫なのかも。

ペイントブラシは退化してる。。。

Windows 7のペイント、リボンインターフェース採用はいいのだけど、機能的に退化。

画像を右クリックでててくるメニューが変わってる。以下、Vistaと7の比較

Windows Vistaのペイントの画像

 

Windows 7のペイントのメニュー画像
Windows 7のペイントの画像

  • ファイルへコピー
  • ファイルからの貼り付け

この2つが無くなった。特に「ファイルへコピー」は使い勝手良かったのに。

Live MeshがWindows 7では一部うまく動かない

超便利ツールmeshなわけだが、これがWindows 7ではうまく動かない。

といっても、ファイル共有部分はきちんと動作。動かないのはリモートデスクトップ部分。

同様の問題はすでに報告されてる感じ。そのうち修正されるか?

ちなみに問題が起きているバージョンは、0.9.4014.7

821SHのファイルをBluetoothでPCに転送する方法

↑ができるとケータイで写真を撮る回数も増える。

以前はメモリカードの抜き差しでPC転送していたのだが、MicroSDになって正直、抜き差しが億劫になった。(MiniSDまではよかったんだけどね)。

で、調べてみると821SHのBluetoothでOSと接続できるのはモデムとしてのみ。ってモデムとして使って通信したら費用が怖いよ。。

で調べてみると、ありました。シャープが配布している ケータイ daSHというソフトの「ハンドセットマネージャーを利用する」というやつです。一応、Windows 7でも動きました。
便利

http://k-tai.sharp.co.jp/support/

Windows 7のログオン画面を変更してみる

LogonStudioというツールで、XPやVistaのログオン画面が変更できる。

元々、Vistaのオーロラが好きではなかったので、完全黒画面にカスタマイズ。

Windows 7では、このツールで新しいログオン画面の作成ができない。というよりも、適用したい画像を読み込むためのダイアログの表示(おそらくコモンコントロール未使用)ができず選択できない。

ただし、Vistaで作成済みのLogonScreenファイルを適用することは可能なので、その方法でカスタマイズ。

LogonStudio
http://www.stardock.com/products/logonstudio/index.asp

Windows 7 Beta

インストールした。

GigaBeatにWMAファイルを、ビットレートをコンバートしつつコピーした。

したら、曲名情報とか落ちるし。。。。

たぶん、VistaやWindows XPでも同じなんだろうな。。。