4/25/2013

安裝 SQL Server 2008時,在檢查"安裝程式支援規則”時出現 『效能計數器登錄區一致性』失敗

找了很多解決方案,包含改regedit很容易不成功,因此....從最遠史的流程動手


setup.exe /ACTION=install /SKIPRULES=PerfMonCounterNotCorruptedCheck
執行以上的參數,會忽略檢查,即可解決此問題。

4/05/2013

移除Win7的捷徑圖示

移除捷徑步驟

步驟一、解開壓縮檔,將Empty.ico放置C:\Windows
步驟二、執行Empty.reg
步驟三、重新開機,即可看到捷徑圖示不見了!

還原捷徑步驟

步驟一、點選Emptyremove.reg,重新開機即恢復預設值

下載

3/07/2013

Printer Server變更方式

常常都會碰到的問題,如何大量變更Client共用 Printer Server 的位置

請使用下列的Code,並儲存成VBScript 的格式

LISTING 1: Logon Script to Automatically Install New Printers
On error resume next

' This code enumerates the user's current network printer connections.
Set WshNetwork = CreateObject("WScript.Network")
Set oPrinters = WshNetwork.EnumPrinterConnections

For j = 0 to oPrinters.Count - 1 Step 2

  ' This code opens a comma-delimited text file containing  
  ' the corresponding old and new printers and assigns
  ' each line as an array variable.
  Const ForReading = 1
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objTextFile = objFSO.OpenTextFile ("C:\printers.txt", ForReading)

   Do Until objTextFile.AtEndOfStream
     strNextLine = objTextFile.Readline
     arrPrinterList = Split(strNextLine , ",")
     ' This section retrieves the registry value corresponding to the  
     ' default printer and assigns the registry value as a string variable.
     const HKEY_CURRENT_USER = &H80000001
     strComputer = "."
     Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _ 
        & strComputer & "\root\default:StdRegProv")
     strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows"
     strValueName = "Device"
     oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
     wscript.echo(strValue)
    ' This code takes both variables defined above and introduces conditional logic.
   
     For i = 1 to Ubound(arrPrinterList)
       If strValue =(arrPrinterList(0)) then
         Wscript.Echo "Your default printer will be changed to: " & arrPrinterList(i)
         WshNetwork.AddWindowsPrinterConnection arrPrinterList(i)
         WshNetwork.SetDefaultPrinter arrPrinterList(i)
         WshNetwork.RemovePrinterConnection arrPrinterList(0)
       Else
         If oPrinters.Item(j+1)=arrPrinterList(0) then
           WshNetwork.RemovePrinterConnection arrPrinterList(0)
           WshNetwork.AddWindowsPrinterConnection arrPrinterList(i)
         End If
     End If
  
     wscript.sleep 15000
     Next
  
   Loop
Next
wscript.echo ""
其中上述的流程需修改的應該是c:\Printers.txt
其內容應該為

\\oldserver\oldprinter,
  \\newserver\newprinter
依照上述流程,儲存後,至用戶端執行即可完成變更,亦可透過AD進行派送完成結果。
以上資訊來自於:http://www.windowsitpro.com/article/migration/print-server-migration-40882