Win7:如何部署定製的Quicklaunch表徵圖-更新

來源:互聯網
上載者:User

Win7:如何部署定製的Quicklaunch表徵圖的更正-更新

 

使用Regedit輸出的reg檔案,不是純文字檔案!所以需要處理一下,才能使用Replace.vbs指令碼來替換其中的字串。這個步驟可以在Make.cmd檔案中完成。

只是增加了幾行代碼:

:: ---------------------------------------------------------------------------------------:::: Make.cmd for Quicklaunch Win7:: :: Description::: After admin make quick launch icons done in current user, this cmd will copy all the nessary info:: to correct folder to be ready for deployment.:: This cmd must be run on the user who make all the icons ready and map to local drive if it is saved:: on network share folder.:::: History:::    Oct 25, 2012:::: Copyright (c) 2012, Tony Liu':::: This program is free software; you can redistribute it and/or:: modify it under the terms of the GNU General Public License:: as published by the Free Software Foundation; either version 2:: of the License, or (at your option) any later version.:::: This program is distributed in the hope that it will be useful,:: but WITHOUT ANY WARRANTY; without even the implied warranty of:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the:: GNU General Public License for more details.:::: You should have received a copy of the GNU General Public License:: along with this program; if not, write to the Free Software:: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.:::: Contact: Tonyliu2ca@gmail.com:: ---------------------------------------------------------------------------------------%~d0cd %~d0%~p0del Shortcuts\*.*del TempRegs\*.*xcopy "%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.*" .\Shortcuts\ /Y /I /E /R /H /Q /Creg export HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband .\TempRegs\Tmp.reg /ytype .\TempRegs\Tmp.reg > .\TempRegs\Taskband.regcscript Replace.vbs .\TempRegs\Taskband.reg "[HKEY_CURRENT_USER\" "[HKEY_USERS\TempHive\"del .\TempRegs\Tmp.reg

另外,原來的Replace.vbs雖然直觀簡單,不過如果是大檔案,還是不適合,所以使用下面的比較好(注1):

If WScript.Arguments.Count <> 3 then  WScript.Echo "usage: Find_And_replace.vbs filename word_to_find replace_with "  WScript.Quitend IfFindAndReplace WScript.Arguments.Item(0), WScript.Arguments.Item(1), WScript.Arguments.Item(2)WScript.Echo "Operation Complete"function FindAndReplace(strFile, strFind, strReplace)    Set objFSO = CreateObject("Scripting.FileSystemObject")    Set objInputFile = objFSO.OpenTextFile(strFile,1)    strTempDir = objFSO.GetSpecialFolder(2)    Set objTempFile = objFSO.OpenTextFile(strTempDir & "\temp.txt",2,true)    do until objInputFile.AtEndOfStream        objTempFile.WriteLine(Replace(objInputFile.ReadLine, strFind, strReplace))    loop    objInputFile.Close    Set objInputFile = Nothing    objTempFile.Close    Set objTempFile = Nothing    objFSO.DeleteFile strFile, true    objFSO.MoveFile strTempDir & "\temp.txt", strFile    Set objFSO = Nothingend function 

注1: http://stackoverflow.com/questions/1975321/find-and-replace-string-in-my-text-with-vbscript

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.