顯示具有 Windows 7 標籤的文章。 顯示所有文章
顯示具有 Windows 7 標籤的文章。 顯示所有文章

2021年12月13日 星期一

FTP Script sample

在Windows環境下:


0.取系統年月值

echo %date:~0,4%%date:~5,2%


1.依系統年月建立 folder (c_folder.bat)

if exist c:\c_customs\%date:~0,4%%date:~5,2%\ (echo Yes) else (md c:\c_customs\%date:~0,4%%date:~5,2%\) 


2.批次執行ftp script 並儲存log (c_ftp.bat)

set log=D:\log\%date:~0,4%%date:~5,2%%date:~8,2%.log ftp -s:D:\FTPcmd.txt >> %log%


3.FTP script內容 (FTPcmd.txt)

open ftp_site
v_username
v_password
prompt
cd ftp_folder
lcd local_folder
mget *.pdf


4.刪除單一檔案或多個檔案

delete 123.pdf
mdelete *.pdf


2020年2月9日 星期日

Windows 7中svchost.exe耗用過多記憶體問題

問題: 記憶體可用量極少, 常出現即將耗盡的訊息, 查看發現是svchost.exe耗用過多



解法: 網路上有多篇文章提到, 是自動更新有問題, 要針對Windows update(Automatic Updates)及Background Intelligent Transfer Service (BITS) 的服務先處理, 再重新註冊DLL:

  REGSVR32 WUAUENG.DLL
  REGSVR32 WUAUENG1.DLL
  REGSVR32 ATL.DLL
  REGSVR32 WUCLTUI.DLL
  REGSVR32 WUPS.DLL
  REGSVR32 WUPS2.DLL
  REGSVR32 WUWEB.DLL


但尷尬了, 有三項出現無法載入模組的錯誤訊息:

  WUAUENG1.DLL
  WUCLTUI.DLL
  WUWEB.DLL



再找了篇文章, 提到可能是系統的檔案毀損, 要執行 sfc /scannow , 結果如下:

  C:\Windows\system32>sfc /scannow

  正在開始系統掃描。這將需要一些時間。

  開始系統掃描的驗證階段。
  驗證 100% 完成。
  Windows 資源保護發現受損檔案,但無法修復其中某些檔案。
  詳細資料請見 CBS.Log windir\Logs\CBS\CBS.log。For example
  C:\Windows\Logs\CBS\CBS.log

  系統檔案修復變更將在下次重新開機後生效。


但CBS.log無法開啟, 看不到內容.

重開機後, 那三個模組還是有相同問題, 再觀察.


Ref:
1.Windows 7
https://answers.microsoft.com/zh-hant/windows/forum/all/window-7/9f4cf084-20ca-49e4-942c-467084ebeb06