'========================================================================== ' VBScript Source File ' NAME: remove_statestore.vbs ' AUTHOR: mathias@haas.se ' DATE : 2011-04-13 ' COMMENT: v1.0 - Deletes the Statestore which USMT can't do... . '========================================================================== 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 ("C:\USMT") = False Then fso.CreateFolder ("C:\USMT") 'For the util. sPath = wshell.CurrentDirectory wshell.Run ("cmd /c copy " & sPath & "\amd64\usmtutils.exe C:\USMT"),0,True ' Copies Util to C:\USMT wshell.Run ("cmd /c echo Y | c:\USMT\usmtutils.exe /rd " & sOSDStateStorePathArg ),0,True fso.DeleteFolder "C:\USMT",True WScript.Quit (0)