파일 및 설정 경로 전환
파일과 설정을 경로 전환하려면 사용자 지정 .xml 파일을 만들고 ScanState 및 LoadState 명령에 모두 이 파일 이름을 지정합니다. 이렇게 하면 변경 내용이 기본 .xml 파일과 별도로 유지되므로 수정 내용을 더 쉽게 추적할 수 있습니다.
이 항목의 내용:
폴더 경로 전환
특정 파일 형식 경로 전환
특정 파일 경로 전환
폴더 경로 전환
다음 사용자 지정 .xml 파일은 C:\EngineeringDrafts의 디렉터리와 파일을 모든 사용자의 내 문서 폴더로 마이그레이션합니다. %CSIDL_PERSONAL%은 CSIDL_MYDOCUMENTS에 해당하는 내 문서 바탕 화면 항목을 나타내는 가상 폴더입니다.
<migration urlid="https://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="https://www.microsoft.com/migration/1.0/migxmlext/test">
<component type="Documents" context="System">
<displayName>All .mp3 files to My Documents</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 파일을 모든 사용자의 내 문서 폴더로 마이그레이션합니다. %CSIDL_PERSONAL%은 CSIDL_MYDOCUMENTS에 해당하는 내 문서 바탕 화면 항목을 나타내는 가상 폴더입니다.
<migration urlid="https://www.microsoft.com/migration/1.0/migxmlext/test">
<component type="Documents" context="User">
<displayName>Sample.doc into My Documents</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>