prndrvr.vbs, prnport.vbs, and prnmngr.vbs just comes up with "useage" - how do I properly execute?


  • Hello, 

    I am trying to create a batch file to install a network printer as this is a task I have to perform repeatedly, and would love a way to streamline it. 

    I am trying to use cscript to call prndrvr.vbs, prnport.vbs, and prnmngr.vbs but it always comes up with the "usage" as seen below. 

    I've gone through it and can't tell where I'm going wrong, the paramaters look correct as far as I can tell. 

    My base code is from here

    Please scroll to the very bottom for my code chunk. 

    Any ideas on what I can try? 

    Any help is greatly appreciated. 


    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.
    Usage: prndrvr [-adlx?] [-m model][-v version][-e environment][-s server]
                   [-u user name][-w password][-h path][-i inf file]
    -a     - add the specified driver
    -d     - delete the specified driver
    -e     - environment  "Windows {NT x86 | X64 | IA64}"
    -h     - driver file path
    -i     - fully qualified inf file name
    -l     - list all drivers
    -m     - driver model name
    -s     - server name
    -u     - user name
    -v     - version
    -w     - password
    -x     - delete all drivers that are not in use
    -?     - display command usage

    @echo off
    goto menu
    echo What would you like to do?
    echo Choice
    echo 1) Install LMC Large Printer
    echo 2) Quit
    set /P C=[1,2]?
    if "%C%"=="2" goto quit
    if "%C%"=="1" goto lmclarge
    goto choice
    cscript.exe C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m “Canon iR7086-7105 PCL6" -v 3 -e “Windows NT X86" -h “W:\\Print Drivers\\Canon Ri7095\\Windows\\Driver\\pcl6” -i “W:\\Print Drivers\\Canon Ri7095\\Windows\\Driver\\pcl6\\P62KUSAL.INF”
    cscript.exe C:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_10.18.66.249 -h -o raw -n 9100
    cscript.exe C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a -p “LMC Large Printer” -r “" -m “Canon iR7086-7105 PCL6"
    goto menu

    2012年6月14日 22:43