ファイルと設定の経路変更

ファイルと設定を再ルーティングするには、カスタム .xml ファイルを作成し、コマンド ラインとLoadState.exeコマンド ラインの両方で .xml ファイル名をScanState.exe指定します。 カスタム .xml ファイルを使用すると、変更を既定 の.xml ファイルとは別に保持できるため、変更を追跡しやすくなります。

フォルダーを再ルーティングする

次のカスタム .xml ファイルは、ディレクトリとファイルをすべての C:\EngineeringDrafts ユーザーの Documents フォルダーに移行します。 %CSIDL_PERSONAL%、ユーザー> デスクトップ項目を<表す仮想フォルダーであり、CSIDL_MYDOCUMENTSと同じです。

<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
<component type="Documents" context="User">
  <displayName>Engineering Drafts Documents to Personal Folder</displayName>
  <role role="Data">
    <rules>
      <!-- Migrate all directories and files present in c:\EngineeringDrafts folder -->
      <include>
        <objectSet>
          <pattern type="File">C:\EngineeringDrafts\* [*]</pattern>
        </objectSet>
      </include>
      <!-- This migrates all files and directories from C:\EngineeringDrafts to every user's personal folder.-->
      <locationModify script="MigXmlHelper.RelativeMove('C:\EngineeringDrafts','%CSIDL_PERSONAL%')">
        <objectSet>
          <pattern type="File">C:\EngineeringDrafts\* [*]</pattern>
        </objectSet>
      </locationModify>
    </rules>
  </role>
</component>
</migration>

特定のファイルの種類を再ルーティングする

次のカスタム .xml ファイルは、ソース コンピューター 上の 固定ドライブにある.mp3ファイルを、コピー先コンピューターの C:\Music フォルダーに再ルーティングします。

<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
<component type="Documents" context="System">
  <displayName>All .mp3 files to the Documents folder</displayName>
  <role role="Data">
    <rules>
      <include>
        <objectSet>
          <script>MigXmlHelper.GenerateDrivePatterns ("* [*.mp3]", "Fixed")</script>
        </objectSet>
      </include>
      <!-- Migrates all the .mp3 files in the store to the C:\Music folder during LoadState -->
      <locationModify script="MigXmlHelper.Move('C:\Music')">
        <objectSet>
          <script>MigXmlHelper.GenerateDrivePatterns ("* [*.mp3]", "Fixed")</script>
        </objectSet>
      </locationModify>
    </rules>
  </role>
</component>
</migration> 

特定のファイルを再ルーティングする

次のカスタム .xml ファイルは、すべてのユーザーの Sample.docDocuments フォルダーにファイルをC:\EngineeringDrafts移行します。 %CSIDL_PERSONAL%、ユーザー> デスクトップ項目を<表す仮想フォルダーであり、CSIDL_MYDOCUMENTSと同じです。

<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
<component type="Documents" context="User">
<displayName>Sample.doc into the Documents folder</displayName>
    <role role="Data">
      <rules>
        <include> 
          <objectSet>     
                 <pattern type="File"> C:\EngineeringDrafts\ [Sample.doc]</pattern>
          </objectSet>
        </include>
       <locationModify script="MigXmlHelper.RelativeMove('C:\EngineeringDrafts','%CSIDL_PERSONAL%')">
        <objectSet>
                 <pattern type="File"> C:\EngineeringDrafts\ [Sample.doc]</pattern>
        </objectSet>
       </locationModify>
      </rules>
    </role>
</component>
</migration>