E.0 瞭解變數

變數是包含 Program Files 與 My Pictures 等系統目錄之路徑的字串。這些變數以百分號 (%) 括住。開始執行個人化移轉時,會自動設定這些變數的值。

例如,變數 %os% 會變成設備上安裝作業系統的目錄。

下表說明了個人化移轉中使用的變數。此表只是列出了 Windows XP 與 Windows 7 中對應的值,但這些變數可用於所有支援的作業系統。以下範例假設作業系統安裝在 C:\ 磁碟機上。

變數

描述

Windows XP 上的值

Windows 7 上的值

applicationdata

包含目前使用者之應用程式專屬資料的應用程式資料目錄

C:\Documents and Settings\<使用者名稱>\Application Data

C:\Users\<使用者名稱>\AppData\Roaming

commonapplicationdata

所有使用者通用的應用程式資料目錄

C:\Documents and Settings\All Users\Application Data

C:\ProgramData

commondesktop

所有使用者通用的桌面目錄

C:\Documents and Settings\All Users\Desktop

C:\Users\Public\Desktop

commondocuments

包含所有使用者通用之文件的文件目錄

C:\Documents and Settings\All Users\Documents

C:\Users\Public\Documents

commonprogramfiles

包含各種應用程式通用之檔案的通用檔案目錄

C:\Program Files\Common Files

C:\Program Files\Common Files

commonstartmenu

包含所有使用者通用之「開始」功能表項目的開始功能表目錄

C:\Documents and Settings\All Users\「開始」功能表

C:\ProgramData\Microsoft\Windows\「開始」功能表

computername

裝置名稱

如果設備名稱為 abc,則變數的值為 abc

如果設備名稱為 abc,則變數的值為 abc

cookies

包含瀏覽器 Cookie 的 Cookie 目錄

C:\Documents and Settings\<使用者名稱>\Cookies

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Windows\Cookies

桌面,桌上型電腦(極少情況)

目前使用者的邏輯桌面

C:\Documents and Settings\<使用者名稱>\桌面\

C:\Users\<使用者名稱>\桌面\

desktopdirectory

實際儲存桌面資訊的桌面目錄

C:\Documents and Settings\<使用者名稱>\桌面

C:\Users\<使用者名稱>\桌面

favorites

包含目前使用者之最愛項目的我的最愛目錄

C:\Documents and Settings\<使用者名稱>\Favorites

C:\Users\<使用者名稱>\Favorites

fonts

包含系統字型的字型目錄

C:\WINDOWS\Fonts

C:\WINDOWS\Fonts

history

包含目前使用者之瀏覽器歷程的歷程目錄

C:\Documents and Settings\<使用者名稱>\Local Settings\History

C:\Users\<使用者名稱>\AppData\Local\Microsoft\Windows\History

internetcache

包含目前使用者之暫存網際網路檔案的暫存網際網路檔案目錄

C:\Documents and Settings\<使用者名稱>\Local Settings\Temporary Internet Files

C:\Users\<使用者名稱>\AppData\Local\Microsoft\Windows\Temporary Internet Files

localapplicationdata

包含目前使用者使用之本地應用程式專屬資料的目錄

C:\Documents and Settings\<使用者名稱>\Local Settings\Application Data

C:\Users\<使用者名稱>\AppData\Local

mymusic

目前使用者的我的音樂目錄

C:\Documents and Settings\<使用者名稱>\My Documents\My Music

C:\Users\<使用者名稱>\Music

mypictures

目前使用者的我的圖片目錄

C:\Documents and Settings\<使用者名稱>\My Documents\My Pictures

C:\Users\<使用者名稱>\Pictures

myvideo

目前使用者的我的視訊目錄

C:\Documents and Settings\<使用者名稱>\My Documents\My Videos

C:\Users\<使用者名稱>\Videos

os

Windows 安裝目錄

C:\WINDOWS

C:\Windows

personal

包含使用者文件的目錄

C:\Documents and Settings\<使用者名稱>\My Documents

C:\Users\<使用者名稱>\Documents

profile

包含目前使用者設定檔的目錄

C:\Documents and Settings\<使用者名稱>

C:\Users\<使用者名稱>

profiles

包含所有使用者設定檔的目錄

C:\Documents and Settings

C:\Users

programs

程式目錄

C:\Documents and Settings\<使用者名稱>\「開始」功能表\程式集

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Windows\「開始」功能表\程式集

quicklaunch

快速啟動目錄

C:\Documents and Settings\<使用者名稱>\Application Data\Microsoft\Internet Explorer\Quick

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

recent

包含使用者最近使用文件之捷徑的目錄

C:\Documents and Settings\<使用者名稱>\Recent

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Windows\Recent

sendto

包含收件者功能表項目的收件者目錄

C:\Documents and Settings\<使用者名稱>\SendTo

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Windows\SendTo

startmenu

包含「開始」功能表項目的開始功能表目錄

C:\Documents and Settings\<使用者名稱>\「開始」功能表

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Windows\「開始」功能表

startup

包含使用者之啟動項目的啟動目錄

C:\Documents and Settings\<使用者名稱>\「開始」功能表\程式集\啟動

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Windows\「開始」功能表\程式集\啟動

system

系統目錄

C:\WINDOWS\system32

C:\WINDOWS\system32

tempdirectory

包含暫存檔案的暫存目錄

C:\DOCUME~1\<使用者名稱>\LOCALS~1\Temp\

C:\Users\<使用者名稱>\AppData\Local\Temp\

templates

儲存文件範本的範本目錄

C:\Documents and Settings\<使用者名稱>\Templates

C:\Users\<使用者名稱>\AppData\Roaming\Microsoft\Windows\Templates

username

目前登入之使用者的名稱

如果使用者名稱為 abc,則變數的值為 abc

如果使用者名稱為 abc,則變數的值為 abc