Virtual SD card tools
Easily create and manage virtual disks on Windows
The vsd package provides two python scripts which are helpful in automating virtual disk creation, deletion, mounting, and unmounting.
Additionally, it comes with several
.bat files which can be double-clicked or executed from the command line to perform the different available commands.
An example of how these scripts can be used is to create a virtual SD card file (
sd.raw) for use with Dolphin Emulator, without having to download unnecessary shareware. (see: WinImage)
To use, simply get all the required software, download and unzip the build package into a folder, and then edit the following variables in
To edit SD card contents, run
create.bat followed by
mount.bat (for subsequent editing, only
mount.bat needs to be executed.)
Then place any files on the newly added disk under “Computer”.
After editing is complete, run
unmount.bat to allow other applications read/write access on the virtual SD card file.
Finally, to enable in Dolphin, make sure that “Insert SD Card” is enabled under “Options” -> “Configure” -> “Wii” -> “Device Settings”
Note that the same general setup can be used for other applications with a little tweaking; it's designed to be fairly generic.
settings.bat– Contains various settings which are used in all of the other
.batscripts. The section at the top should be edited as desired.
create.bat– Creates a new virtual disk file and formats it. If the target path already exists, the user is prompted if it should re-create the file. Additionally, a shortcut to the parent directory of the new file is created.
delete.bat– Deletes the virtual hard disk file, along with the shortcut to its parent directory. If the file is currently mounted, it must be unmounted before deletion will work.
mount.bat– Attempts to mount the virtual disk file to a volume and apply a new letter to it. Additionally creates a shortcut to the new drive letter for ease of access.
unmount.bat– Attempts to unmount the virtual disk file. The shortcut to the drive letter will also be deleted on a successful unmounting.
vsd.py is the main script used for creating, deleting, mounting, and unmounting virtual disk files. It can perform up to 4 of the commands in one execution.
Descriptions of the command line flags and commands follow. Additional info can be obtained by executing
If multiple commands are specified, they will be executed in the order:
They are not executed in the order they appear on the command line.
--create– Creates a new virtual disk file
--delete– Deletes a virtual disk file
--mount– Mounts a virtual disk file to a volume letter
--unmount– Unmounts a virtual disk file
--letteris specified, the disk will only unmount if it is mounted to the specified letter.
--path <value>– The path to the virtual disk file
--size <value>– The virtual disk size in MiB
--label <value>– The disk label used during formatting
--letter <value>– The drive letter a virtual disk file should be mounted to
--file-system <value>– A file system such as FAT, FAT32, NTFS, etc.
shortcut.py is responsible for creating and deleting shortcut. It is designed to be able to create file shortcuts and URI shortcuts as well. It can be used as an imported library, and as such, some of its functionality is not used by the included batch scripts.
shortcut.py was designed to use the pywin32 extensions to help create shortcuts, but it has problems creating directory shortcuts this way. The code remains in the file, but it is never used.
The general format of the command line usage is:
shortcut.py [input_arguments] output_filename.lnk target.ext [shortcut_arguments]
Once filename and target have been specified (either by
--flagged or flagless arguments,) all remaining arguments are used as the arguments of the shortcut file.
Additional info can be obtained by executing
--icon <value>– A path to an icon file, or a file containing icons
--icon-index <value>– The index of the icon within a file, in case there are multiple icons
--working-directory <value>– The working directory the shortcut should start in
--target <value>– The target file or URI the shortcut should point to
--filename <value>– The output filename of the shortcut
--targetis a local file, the filename will end with
--targetis any other URI, the filename will end with