Answer» Hello all,
I am starting to dive headfirst into VBScript, and I am already encountering problems. The following script is designed to run to install some raw TCP/IP ports that can be utilized to install some network computers.
Code: [Select]Set WshShell = CreateObject("WScript.Shell") myKey = "HKLM\SYSTEM\ControlSet001\Control\Print\Monitors\Standard TCP/IP Port\Ports" WshShell.RegWrite myKey&"\","10.0.0.1",Nothing
myKey = "HKLM\SYSTEM\ControlSet001\Control\Print\Monitors\Standard TCP/IP Port\Ports\10.0.0.1" WshShell.RegWrite myKey&"\",Protocol,Nothing WshShell.RegWrite myKey&"\Protocol",1,"REG_DWORD" WshShell.RegWrite myKey&"\",Version,Nothing WshShell.RegWrite myKey&"\Version",2,"REG_DWORD" WshShell.RegWrite myKey&"\",HostName,Nothing WshShell.RegWrite myKey&"\HostName","10.0.0.1","REG_SZ" WshShell.RegWrite myKey&"\",IPAddress,Nothing WshShell.RegWrite myKey&"\IPAddress",,"REG_SZ" WshShell.RegWrite myKey&"\",HWAddress,Nothing WshShell.RegWrite myKey&"\HWAddress",,"REG_SZ" WshShell.RegWrite myKey&"\",PortMonMibPortIndex,Nothing WshShell.RegWrite myKey&"\PortMonMibPortIndex",0,"REG_DWORD" WshShell.RegWrite myKey&"\",PortNumber,Nothing WshShell.RegWrite myKey&"\PortNumber",9100,"REG_DWORD" WshShell.RegWrite myKey&"\","SNMP Community",Nothing WshShell.RegWrite myKey&"\SNMP Community","public","REG_SZ" WshShell.RegWrite myKey&"\","SNMP Enabled",Nothing WshShell.RegWrite myKey&"\SNMP Enabled",1,"REG_DWORD" WshShell.RegWrite myKey&"\","SNMP Index",Nothing WshShell.RegWrite myKey&"\SNMP Index",1,"REG_DWORD"
Set WshShell = Nothing Set myKey=Nothing I've already gone rounds with the server room about setting up a print server and they are not being cooperative (I think they are just being lazy personally), so I've decided to try to do this myself. I do not have full domain admin privileges but I do have enough to do some damage (figuratively speaking.) If anyone has some pointers on what I can do to GO about setting up a print server without help from the server room, that would be helpful as well.
Like I said, I am brand new to VBScript, so please let me know of any blatent syntax errors or any obvious issues that should be addressed. The following is the error that I am getting
Line: 3 Char: 1 Error: Type Mismatch Code: 800A000D Source: Microsoft VBScript runtime error I was able to solve this problem, it seems I MISREAD the usage portion of RegWrite, and I was using "\"s where I shouldn't and not using them where I should. In any CASE, the problem with this method came down to not having permissions to edit the registry this way. Which brings me to my problem. I am an administrator for the LAN within my building, however the parent office has the full administrative rights and responsibilities. They are quick to make sure I don't have any more rights than I absolutely need, but are rather slow when it comes to living up to their responsibilities. The reason I am GOING through all of this trouble with installing printers is that the parent office won't setup a print server for me, nor really help me out with much at all. I have one guy in there who I talk to regularly, and I mentioned to him about GPOs. He told me that if I built the GPO, he could make sure it did it's job on his end, but he wouldn't be able to help me out much more than that. So here is the goal, and possible solution.
Goal: To allow any user within the building the to be able to install any printer in the building.
Issues: Some printer drivers require administrative priviledges when they are installed onto the system. Not everyone is an administrator, nor should they be. Not everyone is tech savvy, so the (almost) COMPLETE automation of the process is desired.
Proposed solution: If there is a way to either write a script that would automate the entire function by them double-clicking the script, that is my ultimate goal. I have been able to do this with some of the machines that are already installed in the .cab file for printer drivers. See below:
Code: [Select]echo off cscript %windir%\system32\Printing_Admin_Scripts\en-US\prnport.vbs -a -s "%computername%" -r 10.2.0.1 -o raw -n 9100>nul cscript %windir%\system32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a -p "HP LJ 2025 211 LM" -m "HP Color Laserjet CP2020 Series PCL6" -r "10.2.0.1">nul exit But this coding does not work if the printer driver is not available in the .cab file.
So I either need help writing a different script for the printers not in the .cab file, or I need help building a GPO to put those printer drivers into the .cab file. Any help is welcome and appreciated.
|