原帖由 veve178 於 2008-11-6 16:38 發表 
係c++用system("del %userprofile%\\Local Settings\\Temp\\a.txt"); 出問題,
彈系統找不到指定的路徑
如果整個.bat寫del %userprofile%\Local Settings\Temp\a.txt 就冇事,可以正常delete..
到底咩問題呢,有冇得解決
點解唔用DeleteFile 呢?
system function 恐怕唔認得%userprofile% 呢D environment variable. 正規既方法應該係用Win32 API GetFolderPath
如果你一定要用environment variable, 用Win32 API GetEnvironmentVariable. |