共用方式為


UWF_Volume.CommitFileDeletion

刪除指定的檔案,並將刪除認可至實體磁碟區。

語法

UInt32 CommitFileDeletion(
    string FileName
);

參數

檔名
[in]字串,包含要刪除的檔案路徑,但不包含驅動器號或磁碟區名稱。 例如:「\users\test.dat」。。

傳回值

傳回指出 WMI 狀態WMI 錯誤常數的 HRESULT 值。

備註

FileName 必須包含實體磁碟區上存在的檔案名稱。 CommitFileDeletion 方法無法刪除不存在的檔案。

您必須使用系統管理員帳戶來呼叫此方法。

需求

Windows 版本 支援
Windows 首頁
Windows 專業版
Windows 企業版
Windows 教育版
Windows IoT 企業版