Windows 8 and 8.1 Forums


VHD - Auto-mount at Startup in Windows 8

  1. #40


    Posts : 2,690
    Windows 3.1 > Windows 10


    MountVHD.cmd
    Code:
    cd /d "%~dp0"
    diskpart /s MountVHD.txt
    exit
    MountVHD.txt
    Code:
    select vdisk file="D:\VHD\Name.vhdx"
    attach vdisk
    assign letter=V
    Place in same folder >
    Name.vhd
    MountVHD.cmd
    MountVHD.txt

    Then create a shortcut to "MountVHD.cmd" in "User" "Programs" "Startup" Folder

    Now when "User" login - the "MountVHD.cmd" is run from the "Startup" Folder (Just a work around to using task manager)

      My System SpecsSystem Spec

  2. #41


    Posts : 5
    Windows


    Thanks Everyone for trying to help. It was my mount script. I realized I was only putting " select vdisk=" instead of "select vdisk file"... The task couldn't start because the script wasn't directing it to the vhdx.
      My System SpecsSystem Spec

  3. #42


    Posts : 5
    Windows 8.1


    @bbrescia - did you ever figure out why you were getting the "There is no volume specified"? I ask because I too am getting that message, but the curious thing is that this script had been working just fine up until several weeks ago. I haven't been able to make troubleshooting this issue a priority until now, so I really don't know what updates/changes might've "broken" this for me.
      My System SpecsSystem Spec

  4. #43


    Posts : 959
    Windows 8.1, 10


    Quote Originally Posted by BWB8771 View Post
    @bbrescia - did you ever figure out why you were getting the "There is no volume specified"? I ask because I too am getting that message, but the curious thing is that this script had been working just fine up until several weeks ago. I haven't been able to make troubleshooting this issue a priority until now, so I really don't know what updates/changes might've "broken" this for me.
    Hi BWB8771

    One thing I would try is to attempt running the commands manually to see if it gives more information. So you could try these steps. If there are any errors, note the message down and type exit to get out of diskpart :
    1. open an elevated command prompt
    2. enter the command: diskpart
    3. when Diskpart loads, enter the command: select vdisk file="{Path to your VHD}"
    4. enter the command: attach vdisk
    5. does that work without generating an error?
    6. If it all worked, enter this command to detach the vdisk: detach vdisk
    7. whatever happened, enter this command to exit diskpart: exit

    Does that work without errors? If there was an error, what was the error message?
      My System SpecsSystem Spec

  5. #44


    Posts : 5
    Windows 8.1


    @DavidY - thanks for taking the time to reply. I encountered no issues or errors while performing your steps 1-7,

    When I run diskpart /s c:\batch\Attach_VHD.txt I encounter:
    There is no volume specified.
    Please select a volume and try again.

    The script in the "Attach_VHD.txt" is:
    select vdisk file=Z:\FileHistory.vhd
    attach vdisk
    rescan
    rescan
    rescan
    rescan
    select partition 1
    assign letter=H


    The italicized lines were ones that I added on anecdotal advice in this thread.

    Even though I am still getting that "no volume.." message, my VHD successfully mounts to drive H:, so I am okay with this. Of course, now that I've said/posted that, I'm going to jinx myself :-)
      My System SpecsSystem Spec

  6. #45


    Posts : 959
    Windows 8.1, 10


    Quote Originally Posted by BWB8771 View Post
    @DavidY - thanks for taking the time to reply. I encountered no issues or errors while performing your steps 1-7,
    ....
    Even though I am still getting that "no volume.." message, my VHD successfully mounts to drive H:, so I am okay with this. Of course, now that I've said/posted that, I'm going to jinx myself :-)
    Right I think I know what's happening.... I think I made a mistake in the original tutorial! Apologies!

    The statement "assign letter=h" should be deleted from the script file - I think the best way to set the driver letter is in disk management when the VHD is created, or use disk management to change it later. Luckily, once you've assigned a letter to a VHD, it 'remembers' it the next time it starts up.

    The command "assign letter=h" only seems to work in diskpart if you have already selected the volume beforehand, and I think the only ways to select a vdisk volume are (a) if it already has a drive letter, or (b) if you know the volume number - which could vary depending on other factors so I'm not sure there's a safe way to determine that at run time if it is being called by Task Scheduler.
      My System SpecsSystem Spec

  7. #46


    Posts : 1
    WINDOWS 10


    Hi,

    I have applied the procedure (included assign letter ...) ant it works. Thanks for procedure ... it's very useful to overcome a very annoying problem on Windows 10: impossible put OneDrive folders in SD card. I find the solution more/less at the beginning of august.

    The Auto_mount procedure stopped to work after 3 days ... I discovered that there is a parameter to uncheck. ("configuration tab", "Stop if ... 3 days was checked by default)

    But today, in september, the auto Mount hasn't work again ... and I do not have any idea: there is a message in Planning Utility Window: "Parameter not correct (0x80070057)".

    Do you have any idea?

    Thanks.

    Massimo
      My System SpecsSystem Spec

  8. #47


    Posts : 959
    Windows 8.1, 10


    Quote Originally Posted by mpiva View Post
    Hi,

    I have applied the procedure (included assign letter ...) ant it works. Thanks for procedure ... it's very useful to overcome a very annoying problem on Windows 10: impossible put OneDrive folders in SD card. I find the solution more/less at the beginning of august.

    The Auto_mount procedure stopped to work after 3 days ... I discovered that there is a parameter to uncheck. ("configuration tab", "Stop if ... 3 days was checked by default)

    But today, in september, the auto Mount hasn't work again ... and I do not have any idea: there is a message in Planning Utility Window: "Parameter not correct (0x80070057)".

    Do you have any idea?

    Thanks.

    Massimo
    Hi Massimo,

    I'm not sure.

    Could you post a copy of the script you are using, and a screenshot of Task Scheduler, showing the command you are running?

    David
      My System SpecsSystem Spec

  9. #48


    Posts : 2
    Win 10, Win 8.1, Linux,


    This is a great fix... and updating to Win 10 broke it somehow.

    Any help would be much appreciated!

    I'm running an Asus Transformer Tablet (originally win 8.1, now win 10). Like I said, I had it working great when the tablet was running Win 8.1, and the updated to Win 10 apparently killed it.

    The VHDX is on an SD card, drive letter D. I can open diskpart and manually enter the text in my mount script.txt file and it all works, so I'm really stumped as to why the mount script itself doesn't work.

    When I try running the mount script.txt from Run, a command window pops up and disappears without doing anything. Anyway, here are my settings:

    VHDX location:
    D:\Media Store.vhdx

    text file location:
    C:\external card\mount script.txt

    Click image for larger version

    Click image for larger version

    text of mount script:

    select vdisk file="D:\Media Store.vhdx"
    attach vdisk
    assign letter=f

    FWIW, under last run result I get "Unspecified error (0x80004005)".

    EDIT:

    I tried running thte script from an elevated command prompt and got the error message:
    DiskPart was unable to open or read the script file.
    Make sure the file you specified exists.
      My System SpecsSystem Spec

  10. #49


    Posts : 2,690
    Windows 3.1 > Windows 10


    in your second screen shot put quotes " " around "C:\ blah blah.txt"

    command prompt does not like SPACES in names unless in qoutes
      My System SpecsSystem Spec

Page 5 of 7 FirstFirst ... 34567 LastLast
VHD - Auto-mount at Startup in Windows 8
Related Threads
BSOD Error On Startup - Auto Restarts in BSOD Crashes and Debugging
Hello, My little brothers desktop PC that is running Windows 8.1 keeps going to the BSOD on every startup i do, once it restarts and goes back to desktop it seems to run fine and doesnt BSOD which is quite frustrating. I've zipped up the files needed for you guys to have a view (following the...
Hello, i'm running Windows 8 Home Premium. I'd like to increase my startup speeds, I already disabled as much as I can in Task Manager, msconfig, etc. In the Task Scheduler, it shows Metro Apps are taking CPU time at startup though. After much searching on the topic, I find very little about how...
As the title said. Someone my programs that has yellow-blue shield like this 41798 fail to autostart at log-on or windows startup. I tried many ways: registry, put their shortcuts in startup folder, changed gpedit.msc so that they start on log-on... none of them works. Is there anyway to fix this,...
I'd like to change the order in which certain programs in my startup folder load. I don't need to know how to add or remove programs from the startup folder, and I'm not talking about security or system programs. I'm talking about some programs I've added to my computer, which I use all the time in...
System Specs Intel i5 2400 3.10 Ghz8Gb of Ram1TB SATA HDDAMD Radeon HD 6670motherboard Z77M-D3H rev 1.0Windows 8 Pro X64 Problem: for the past few weeks this problem begun and i dont know how but it just happenedfirst i was wondering why so i checked event viewer and logs involving the...
I apologise if this is the wrong section, this isnt strictly a BSOD crash. Yesterday when shutting down my laptop (which has been upgraded to windows 8 Pro Previously, without issue) windows 8 installed an update. Since then, when trying to boot, windows hangs on the loading scree (spinning...
Hello All, I have a problem in windows 8 32 bit to auto lunch my application at boot up/start up. Actually I already created registry in: and while I am also created registry in:
Eight Forums Android App Eight Forums IOS App Follow us on Facebook