建立自訂檔案管理工作Create a Custom File Management Task

適用於:Windows Server (半年度管道)、Windows Server 2016、Windows Server 2012 R2、Windows Server 2012、Windows Server 2008 R2Applies to: Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2

不一定都要對檔案執行到期動作。Expiration is not always a desired action to be performed on files. 檔案管理工作也可讓您執行自訂的命令。File management tasks allow you to run custom commands as well.

注意

此程序假設您熟悉檔案管理工作,因此僅探討設定自訂設定所在的 [動作] 索引標籤。This procedure assumes that you are familiar with file management tasks, and therefore only covers the Action tab where custom settings are configured.

若要建立自訂工作To create a custom task

  1. 按一下 [檔案管理工作] 節點。Click the File Management Tasks node.

  2. [檔案管理工作] 上按滑鼠右鍵,再按一下 [建立檔案管理工作] (或按一下 [動作] 窗格中的 [建立檔案管理工作])。Right-click File Management Tasks, and then click Create File Management Task (or click Create File Management Task in the Actions pane). 如此會開啟 [建立檔案管理工作] 對話方塊。This opens the Create File Management Task dialog box.

  3. [動作] 索引標籤中,輸入下列資訊:On the Action tab, enter the following information:

    • [類型]Type. 從下拉式功能表選取 [自訂]Select Custom from the drop-down menu.
    • [可執行檔]Executable. 輸入要在檔案管理工作處理檔案時執行的命令,或瀏覽至該命令。Type or browse to a command to run when the file management task processes files. 這個可執行檔必須設定為僅可由系統管理員及系統寫入。This executable must be set to be writable by Administrators and System only. 如果任何其他使用者擁有可執行檔的寫入存取權,可執行檔將無法正確執行。If any other users have write access to the executable, it will not run correctly.
    • [命令設定]Command settings. 若要設定要在檔案管理工作處理檔案時傳遞給可執行檔的引數,請編輯標籤為 [引數] 的文字方塊。To configure the arguments passed to the executable when a file management job processes files, edit the text box labeled Arguments. 若要在文字中插入其他變數,請將游標放在要插入變數的文字方塊中、選取您想要插入的變數,然後按一下 [插入變數]To insert additional variables in the text, place the cursor in the location in the text box where you want to insert the variable, select the variable that you want to insert, and then click Insert Variable. 方括弧中的文字會插入可執行檔可以接收的變數資訊。The text that is in brackets inserts variable information that the executable can receive. 例如,[Source File Path] 變數會插入須由可執行檔處理之檔案的名稱。For example, the [Source File Path] variable inserts the name of the file that should be processed by the executable. 或者,按一下 [工作目錄] 按鈕以指定自訂可執行檔的位置。Optionally, click the Working directory button to specify the location of the custom executable.
    • [命令安全性]Command Security. 設定這個可執行檔的安全性設定。Configure the security settings for this executable. 預設會以本機服務身分執行命令,這是限制最多的可用帳戶。By default, the command is run as Local Service, which is the most restrictive account available.
  4. 按一下 [確定]Click OK.

請參閱See also