重設檔案和設定的路徑
若要重新路由檔案和設定,請建立自定義 .xml 檔,並在和 LoadState.exe
命令行上指定 ScanState.exe
.xml 檔名。 自定義 .xml 檔案可讓變更與預設 .xml 檔案分開,以便更輕鬆地追蹤修改。
重新路由資料夾
下列自定義 .xml 檔案會將目錄和檔案從 C:\EngineeringDrafts
移轉至每個使用者的 Documents 檔案 夾。
%CSIDL_PERSONAL% 是代表 <User> 桌面項目的虛擬資料夾,相當於 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 檔案會將檔案從 C:\EngineeringDrafts
移轉Sample.doc
至每個使用者的 Documents 檔案夾。
%CSIDL_PERSONAL% 是代表 <User> 桌面項目的虛擬資料夾,相當於 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>