????? ????? ???? ???????? ???? ?????? ?? ????????? ???????? ????????

?????? ????????? ?????? ?????????
???? ???????: 304767 - ??? ???????? ???? ????? ????? ??? ???????.
???: ????? ??? ??????? ??? ??????? ??? ????? ???????. ??? ????? ?????? ???? ?? ??? ???? ???????? ??????? ?? ???? ?????? ???????? ?? ???? ???? ?????. ?????? ??? ??????? ??? ????? ??? ???? ???????? ?? ????? ????????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
256986??? ????? Microsoft Windows
????? ???? | ?? ????

?? ??? ??????

??????

??? ??????? ??? ??? ?????? ?????? ??????? ????? ????? ????? ??????? ?????????? ?????? ???? ???????? ?? ??????? ??????? ????????. ??? ???? ?? ??? ????? ?? ?? ???? ??? ?????? ???????. ???? ??? ??????? ???????? ???? ????? ????????? ?????? ??? ??????.

??????? ????

?????: ???? ??????? "???? ???????" ?????? ??? ?????? ?? ???? ???? ?????? ????? ???? ????? ????? ???? ???????. ??? ???? Microsoft ?? ???????? ???? ???? ?? ??????? "???? ???????" ?????? ??? ?????. ?????? "???? ???????" ??? ???????? ??????.

???: ????????? ???????? ?? ??? ??????? ???? ????????? ?????? ?????? ??????. ??? ??????? ?? ?? ????? ??????? ?? ??? ??????? ?? ?????? ?????? ??? ??? ?????? ??????? ?????? ?? ???? ??????.

?? ????? ???????? ?????? ?? ??????? ??????? ??????? ???????? ????? ??? ??? ????? ??????? ?????????? ??? ????? HKEY_CURRENT_USER ?? ???????. ?????? ??? ?????? ?????? ???? ????? ???????.

??????? ??????

????? ??????? ??????? ?????????? ??????? ????? ?????? ?? ??? ??????? ?? ??? ????? ???????? ????? ???? ???????? ?????? ?????? ??? ?????????:
  1. ?????? ???? ??????? (Regedit.exe) ?????? ????? ??????? ??????:
    NT\CurrentVersion\Windows HKEY_CURRENT_USER\Software\Microsoft\Windows
  2. ????? ??? ??????? (.reg) ???? ?????? ?? ?????? 1 ?????? ???? ?? ???? ??? ??? ??? ???? ??????? ??? ???????:
    "????" =...
    ???? ?? ??? ??????? ??? ?? ????? ??? ??? ???? ???? ?????.
  3. ?????? ???? ??????? (Regedit.exe) ?????? ???? ????? ResetPrinter ????? ??? ????? ??????? ??????:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
  4. ??? ?? ???? ?????? ???? ResetPrinter ????? ???? ?????? ???????
    -S REGEDIT.EXE ???? \ File.reg
    ??? File.reg ?? ????? ????? ????????? ?????? ??????? ??????????.

??????? ???????

??? ???? ????? ????????? ?? ????? ????? ????? ??? ????? ????? ????????? ???????? ? ????? ??????? ??? ???????? ??? .vbs ???? ?????? ?? ?????? ????? ?? ?????? ?? ??? ????????? ????? ?????? ????? ???????. ????? ????? ???????? ???????? ??????? ?? ??? ??????? ??? ????? ???? IF. ??? ???? ??????? ????? ?????? IF ?????? ?? ????????? ???????? ???"??? ??? ??? ????????? ??? ????"LAB1-"? ?? ????? ??????? ?????????? ???"\\LAB1\LaserJet". ?????? ??? ???????:
  1. ??? ??? VBS ????? ??????? ???. vbs ?????, ??? ???? ??????? Defaultprinter.vbs:
    Option Explicit
    DIM RegEntry, ComputerName
    
    RegEntry="HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
    ComputerName = ReadRegValue(RegEntry)
    
    if InStr(1,ucase(ComputerName),"LAB1-",vbTextCompare) > 0 then call SetPrinter("\\LAB1\LaserJet")
    if InStr(1,ucase(ComputerName),"LAB2-",vbTextCompare) > 0 then call SetPrinter("\\LAB2\LaserJet")
    if InStr(1,ucase(ComputerName),"OFFICE-",vbTextCompare) > 0 then call SetPrinter("\\OFFICE\LaserJet")
    'so on and so forth.
    wscript.quit
    
    ' ***  This subroutine installs and sets the default printer
    Sub SetPrinter(ByVal PrinterPath)
      DIM WshNetwork
      Set WshNetwork = CreateObject("WScript.Network") 
      WshNetwork.AddWindowsPrinterConnection(PrinterPath)
      WshNetwork.SetDefaultPrinter Printerpath
    end sub
    
    ' ****  This function returns the data in the registry value
    Function ReadRegValue(ByVal RegValue)      
      DIM WSHShell
      Set WSHShell = WScript.CreateObject("WScript.Shell")
      ReadRegValue=""
      On Error Resume Next
      ReadRegValue= WSHShell.RegRead(RegValue)
    End Function
    					
  2. ????? ???? IF ??? ??????. ??? ??? ?? ???? IF ???? ????? ??? ????? ??? ?????? ?????? ??????. ?????? ?? ????? ??? ????? ???? IF ??????.
  3. ?????? "???? ???????" ?????? ???? ????? ResetPrinter ??? ????? ??????? ??????:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
  4. ??? ?? ???? ???? ResetPrinter ????? ???? ?????? ???????
    \DefaultPrinter.vbs ???? WSCRIPT.EXE
    ??? ?? path ?? ???? ????? ??? Defaultprinter.vbs.

?????????

?? ?????? ????? ????? ????? Defaultprinter.vbs ?? ?????? ??? ?????? ???? ????? ?? ????? ???????. ?? ?? ????? ??????? ?? ??? ??????? ????? ????? ??????? ?????????? ???? ??? ????? ??????? ??????? ???????? ??? ???????. ?????? ??? ?? ??? ????? ???????? ????? ???????? ??????? ?? ??? ??????? ???? ????, ?? ????? ??? ????? ?? ????? Windows Scripting Host ?? ???? Microsoft ?????? ??? ?????:
http://www.microsoft.com/downloads/details.aspx?FamilyID=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
???? Microsoft ??????? ???????? ??? ??? ?? ???? ??????? ?? ?? ?????. ??? ????? ???? ?? ????? ??? ???????? ??????? ?????? ???????? ?? ???????? ???? ????. ????? ??? ??????? ???? ?????? ?? ??? ??????? ???? ??? ????? ?? ??????? ???? ??? ????????? ?????? ?????? ?????????. ???? ??????? ????? ??? Microsoft ??? ????? ????? ???? ???? ?? ?????? ?????? ??? ??????? ?????? ????? ?????? ?? ????? ??????? ?????? ??????? ?????.

???????

???? ???????: 304767 - ????? ??? ??????: 23/???/1428 - ??????: 5.5
????? ???
  • Microsoft Windows 2000 Professional SP1
  • Microsoft Windows 2000 Professional SP2
????? ??????: 
kbmt kbenv kbhowto kbnetwork kbprint KB304767 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????304767

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com