2012年8月29日 星期三

Excel 表格中取出長路徑字串中的檔名

我有一個Excel 的Cell,是一長串的檔名路徑,我只要取最後的檔名,這困擾著我..
[
\Device\HarddiskVolume4\partir\Lotus\Notes\framework\shared\eclipse\features\com.ibm.collaboration.realtime.telephony.prod.feature_8.0.2.20100802-0849\feature_hu.properties
]
有一些formula 如 Left(B) / Right(B) / Find / SEARCH ,感覺沒一個可用的,算了..
自己建一個 Formula 來處理吧!

作法:

1. 開啟 Excel 2010 及文件
2. 移至[檢視]
3. 點選[巨集]
4. 填入巨集名稱: [RightOfBackSlash] -> 建立
5. 自動開出一個模組(Module1)於VBAProject 中,將下方程式貼上

Function RightOfBackSlash(strTmp As String)
    While InStr(strTmp, "\") > 0
        strTmp = Right(strTmp, Len(strTmp) - InStr(strTmp, "\"))
    Wend
     RightOfBackSlash = strTmp
End Function
6. Formula 建立完成
7. 於Excel 的New Cell中 ,填上 =RightOfBaclSlash( "OldCell")
8. 完成, 自動取出最後一個檔名




2012年8月3日 星期五

使用GPO關閉Windows Services

最近防毒軟體新版的網頁防禦功能有點問題,將部份使用IP為網站的網頁,認定為惡意網站,相對的,網站 Redirect 的行為通通被防毒軟體檔下來,連開啟default.htm都不行,甚為困擾!

還好Windows GPO可管理 Services,將Services設為Disable 即可。在此稍稍記錄..以免忘記!!

1. 建立[Disable_SWI_Serivces]的GPO

2. 編輯[Disable_SWI_Service]的GPO:於[Computer Configuration] =>  Policies => Windows Settings => Security Settings => System Services => 選擇要Dsiable 的Services

3. 設定Service: 勾選[Define this policy setting]來啟動設定 =>設定狀態為[Disabled] =>確認並關閉編輯



4. 套用GPO到適當的OU

5. Windows Client 下: gpupdate /force 來立即更新