Quantcast
Channel: Spiceworks Community
Viewing all articles
Browse latest Browse all 5334

disk2vhd backup script

$
0
0

i have this script which I want to run. I want my c: drive to backup via DISK2VHD to e drive.

but when i run it as a .cmd file it does not work.

what im i missing.

@echo off

for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt={%dt%(%tm%)}
set LogFile="E:\vhd\logs\%computername%-%dt%-vhdlog.txt"
set VHDFileName="E:\vhd\%computername%-%dt%.VHD"
set FolderToDisk2VHD=C:\drivers\disk2vhd

echo Starting Disk2VHD at: %dtt% > %LogFile%

"%FolderToDisk2VHD%\disk2vhd.exe" -accepteula c:, %VHDFileName% >> %LogFile% 2>&1

Rem Pre-Cleanup
set dt=
set tm=
set dtt=

for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt={%dt%(%tm%)}

echo Disk2VHD exited with an exit code of: %errorlevel% >> %LogFile%

echo Finished Disk2VHD at: %dtt% >> %LogFile%

Rem PostCleanup
set LogFile=
set VHDFileName=
set FolderToDisk2VHD=
set dt=
set tm=
set dtt=


Viewing all articles
Browse latest Browse all 5334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>