'========================================================================== ' VBScript Source File ' NAME: copy_and_runscanstate.vbs ' AUTHOR: mathias@haas.se ' DATE : 2011-04-13 ' COMMENT: v1.1 ' Does USMT hardlinking offline from WinPE. Thanks to Niall Brady for the idea. '============================================================================== Option Explicit Dim fso, wshell, sPath, sOSDStateStorePathArg Set fso = CreateObject("Scripting.FileSystemObject") Set wshell = CreateObject("WScript.Shell") sOSDStateStorePathArg = WScript.Arguments.Item(0) If fso.FolderExists (sOSDStateStorePathArg) = False Then fso.CreateFolder (sOSDStateStorePathArg) 'Store our migration data during scanstate operations If fso.FolderExists ("C:\USMT") = False Then fso.CreateFolder ("C:\USMT") 'Stores scanstate native files. If fso.FolderExists ("C:\Temp") = False Then fso.CreateFolder ("C:\Temp") 'Stores scanstate native files. sPath = wshell.CurrentDirectory wshell.Run ("cmd /c xcopy " & sPath & "\amd64 C:\USMT /hericy"),0,True ' Copies all relevant binaries and stuff to C:\usmt\amd64 wshell.Run ("cmd /c SET "&chr(34)&"USMT_WORKING_DIR=C:\Temp"&chr(34)&" & C:\USMT\scanstate.exe " & sOSDStateStorePathArg & " /c /o /hardlink /efs:hardlink /nocompress /offlinewindir:c:\windows /v:5 /l:c:\windows\temp\SMSTSLog\scanstate.log /i:c:\USMT\miguser.xml /i:c:\USMT\migapp.xml"),0,True WScript.Quit (0)