Code Monkey home page Code Monkey logo

vhdmount's Introduction

py-vhdmount

This Python program can mount/unmount VHD or VHDX virtual image as a drive or a folder on Windows. The main purpose of this project is helping testing jobs easier, I wanna save my time on manual testing.

  • This vhdmount.py is based on DISKPART which is an utility of Microsoft.
  • Run it as Administrator, because the requirement of DISKPART utility.

Welcome to use my code to save your time too, you can do anything you like with my source code. File bugs to me if you found something wrong, if you are more aggressive PR is appreciate.

Run Test

The cmd-test.cmd file is a test and also a demonstration. Please run it first.

  1. Launch a console with Administrator.
  2. Go to the project repo.
  3. Run cmd-test.cmd
  4. Check the result is "PASS"

Script Files

  • cmd-test.cmd
  • cmd-extract-vhd.cmd
  • cmd-mount.cmd
  • cmd-unmount.cmd

Usage

There is a vhdfile-10mb.vhd VHD image in the vhdfile-10mb.zip file. You need to unzip it first to the project root folder. Then try the following examples.

python vhdmount.py -h
usage: vhdmount.py [-h] [-mount] [-unmount] -source SOURCE [-folder FOLDER] [-drive  DRIVE]

optional arguments:
  -h, --help      show this help message and exit
  -mount          mount a vhd image.
  -unmount        unmount a vhd image.
  -source SOURCE  vhd image file location
  -folder FOLDER  target mount point foler
  -drive  DRIVE   target mount disk letter

:: Mount a VHD image file as a folder(mount-point)
python vhdmount.py -mount -source vhdfile-10mb.vhd -folder mount-point

:: Unmount the folder or drive and detach the VHD image from system.
python vhdmount.py -unmount -source vhdfile-10mb.vhd

1 2

LICENSE

MIT

vhdmount's People

Contributors

dougpuob avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.