spacer
A Tip From Kinetic Computer Services ...

Need to automatically attach virtual disk on Windows Server


Previous tip: Cannot open .PST file in Microsoft Outlook
Next tip: Trend Micro WFBS Instllation Cannot Remove Symantec Product

Tips Main Page

Description of the Problem

You have a virtual disk on your Windows Server system that you need to automatically be attached every time the system is booted. For example, you may be using a virtual disk as a backup destination for Windows Server Backup.

Solution

First, create a simple Notepad script to attach the virtual disk:

select vdisk file="your vdisk"
attach vdisk

Example:

select vdisk file="f:\server backup.vhdx"
attach vdisk

Give the script a .TXT extension and save it in a convenient folder, for example, "c:\users\administrator\attach.txt".

Now, create a scheduled task to launch the script automatically whenever the system is booted.

  1. Go to Administrative Tools->Task Scheduler.
  2. Choose "Create Task."
  3. On the General tab, give the task a name, e.g. "Attach vdisk." Select "Run whether user is looged on or not" and "Run with highest privileges." Assign it to an Administrator user and enter the password.
  4. On the Triggers tab, add a new trigger, "At startup."
  5. On the Actions tab, select "Start a progam." In the "Program/script" textbox, enter diskpart. In the "Add arguments (optional)" textbox, enter /s followed by the filespec of the script you created above, enclosed in quotes. For example: /s "c:\users\administrator\attach.txt".
  6. Select OK to finish creating the scheduled task.

The virtual disk will now be attached whenever the system is rebooted.

David Carson
Posted on February 25, 2020
© Copyright Kinetic Computer Services

Previous tip: Cannot open .PST file in Microsoft Outlook
Next tip: Trend Micro WFBS Instllation Cannot Remove Symantec Product

Tips Main Page

This tip is a free service of Kinetic Computer Services - professional network consultants serving the Houston area since 1998.

Reproduction of this document without the author's consent is prohibited.


spacer