Diskshadow command in Windows
Applies to : Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012.
Diskshadow.exe is a tool that shows the functions provided by Volume Shadow Service (VSS). By default, the diskshadow command uses an interactive command interpreter, similar to diskraid or DiskPart. The diskshadow command also includes a Scriptable Mode ( writeable mode ).
Note:
As a local or equivalent administrator, the minimum required to run the diskshadow command .
For examples of how to use the diskshadow command , please see the Example below.
Syntax
With interactive mode, type the following command at the command prompt to start the diskshadow command interpreter :
diskshadow
With script mode (script mode), enter the following, in which script.txt is a script file containing diskshadow commands :
diskshadow -s script.txt
Diskshadow commands
You can run the following commands in the diskshadow command interpreter or through the script file:
ParametersDescriptionset_2 Set context, options, verbose mode and metadata files to create hidden copies. Simulate restore Check the writers' participation in recovery sessions on the computer without giving the writers PreRestore or PostRestore events. Load metadata Load the .cab metadata file before importing a hidden copy that can transmit, or download the writer's metadata, in case of recovery. writer Verify that a writer or a component is included or excluded from a writer or a component from the backup or restore procedure. add_1 Add a drive to the set of hidden copies or add aliases to the environment. create_1 Start the process of creating a shadow copy, using the current context and optional settings. exec Executes a file on the local computer. Begin backup Start a full backup session. End backup End a full backup session and issue a Backupcomplete event with the appropriate logging state, if needed. Begin restore Start a recovery session and offer a PreRestore event for the relevant writers. End restore End the recovery session and release the PostRestore event for the relevant writers. reset Reset the diskshadow command to the default state. list List writers, hidden copies, or registered hidden copy providers on the system. delete shadows Delete hidden copies. import Importing a hidden copy can transfer from the loaded metadata file into the system. mask Removes the hardware shadow copies that were imported using the import command . expose Shows a continuously hidden copy, such as a drive letter, shared or mount point. unexpose Hide a hidden copy from being revealed using the expose command. break_2 Unlink a hidden copy from VSS. revert Revert a drive back to a specified hidden copy. exit_1 Exit the diskshadow command .Note
At a minimum, to create hidden copies, just adding and creating is enough. However, this will lose context and optional settings. It will be merely a backup and will only create a hidden copy without the script executing the backup command.
For example
This is a series of sample commands that will create a hidden copy for backup. It can be saved as a file in the form of script.dsh and executed with the diskshadow / s script.dsh script.
Assume the following:
- You have an existing folder named C: diskshadowdata.
- Your system drive is C: and your data drive is D :.
- You have a backupscript.cmd file in C: diskshadowdata.
- Your backupscript.cmd file will copy the hidden data p: and q: to the backup drive.
You can manually enter these commands or use the following script:
#diskshadow script file set context persistent nowriters set metadata c:diskshadowdataexample.cab set verbose on begin backup add volume c: alias Systemvolumeshadow add volume d: alias Datavolumeshadow create expose %Systemvolumeshadow% p: expose %Datavolumeshadow% q: exec c:diskshadowdatabackupscript.cmd end backup #End of script
See more:
- The dfsrmig command in Windows
- Diskcopy command in Windows
- Defrag command in Windows
You should read it
May be interested
- Instructions for using Command Promptdeep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
- Rd command in Windowsthe rd command helps delete a directory
- Cmd command in Windowsthe cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
- How to use the command history function in Command Promptcommand prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
- The sfc command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- Reg command copy in Windowsto copy an entry to the location specified on the local pc or the remote computer we will use the reg copy command. to learn more about how to use the reg copy command, you can track the syntax, explain the command parameters and the example tipsmake.com has compiled below.
- Fc command in Windowsthe fc command compares two files or a collection of files and displays the differences between them.
- The echo command in Windowsthe echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
- Xcopy command in Windowsthe xcopy command is a command prompt command used to copy one or more files or folders from one location to another. with many options and the ability to copy entire directories, the xcopy command is similar to, but much more powerful, than the copy command.
- The cacls command in Windowsthe cacls command displays or modifies an arbitrary access control list (dacl) on the specified file. the command applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012.