2013-03-05 8 views
2

有誰知道是否有Windows API返回hiberfil.sys的位置?用於Hiberfil.sys位置的Windows API

非常感謝,當你啓用休眠,並已休眠您的電腦至少一次

+0

你試過Google嗎?有一個線程可能會有所幫助:http://social.technet.microsoft.com/Forums/en-US/w7itproui/thread/b5baa5bf-bdb2-4c9e-8795-1441f59700a0/ – Joulukuusi 2013-03-05 15:24:31

+6

如果您的程序依賴於hyberfil.sys然後你做錯了。 Hyberfil是一個系統關鍵組件。別碰它。 – SecurityMatt 2013-03-05 19:07:15

回答

0

的hiberfil.sys創建。它的位置可以像其他任何文件一樣確定:指示操作系統進行搜索。它的通常位置在系統驅動器的根目錄下,通常是C :.這個工作powershell腳本被發現here。請參閱完整腳本鏈接,但這是核心:

gwmi cim_datafile -filter "path='\\'" | ? {$_.name -match 'hiberfil.sys'} or 

gwmi -Query "Associators of {Win32_Directory.Name='C:\'} Where ResultClass=CIM_DataFile" | ? {$_.name -match 'hiberfil.sys'} 

也有幫助,卡爾。 E. Peterson的API參考號: http://vb.mvps.org/samples/apixref.asp

他還提供了一些示例代碼,zipped up。希望這可以幫助...

+1

不能保證在將來的Windows版本中將休眠文件稱爲「hiberfil.sys」。 – 2013-03-06 15:22:39