Re: sms installer- automate installing local printer

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: TerryM (terry_at_nospam.com)
Date: 11/08/04

  • Next message: SMS Newbie in the Block: "SMS Client Agent will not install completely"
    Date: Mon, 8 Nov 2004 10:54:03 -0800
    
    

    Glad it is working,
    I still would suggest against the set variable sys and the set variable
    sys32..

    those variables are default SMSI variables that get set to the system and
    system32 directories on each machine regardless of what the exact paths are.

    I would use different variable names for yours. I also don't really see the
    need to add to path.

    I also still think while your script works you should repackage the
    install... whenever you have exe's launching scripts, doing stuff... it gets
    complicated, I have seen times when permissions don't carry over, etc...

    It is much simpler to just repackage the install.

    So basically ask your self (or use SMSI to tell you) what happens to the
    file system and the registry when a printer is installed? Entries are made
    in specific places, dlls are registered, files are placed... etc... just
    write your script to add the right stuff the right places, then you wont
    even need to launch scripts or cmdlines.

    As for your question cmd.exe /c executes the command window then passes the
    stuff after the /c to execute, then it closes. If you had used a /k instead
    it does the same thing but keep the cmd window open afterwards.

    You can append the other exe to the end of this script,... with another cmd.
    One thing I always do though is give it a little time, maybe a few seconds
    at the end before going on to the next thing.

    So you could keep this script then do another execute at the end or I
    recommend:

    Repackage the printer install
    Repackage the active x install

    Also I would recommend you go in and change the installation properties.

    I don't like logs for simple things like this, so I would turn that off, I
    would also change to % in script, then get rid of all dialogs, gradients,
    etc... then in the script remove the check disk space (unless it is really a
    concern).

    Basically make your script as clean as possible. Try to do everything
    through SMSI commands rather than launching vbs if you can help it.

    That's about it, Let me know if you have other questions.

    Terry

    "SMS-Curious guy" <SMSCuriousguy@discussions.microsoft.com> wrote in message
    news:E619F06D-3383-42C5-AC9C-DA8BA592985D@microsoft.com...
    > Terry-That worked!! Now just one more question below
    >
    > This is the script I used- I just needed to make that cscript.exe as that
    > is
    > the name of the file-I am yet to test it on win2k and nt 4.0 hopefully it
    > will work the same.
    > item: Add Directory to Path
    > Directory=C:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > end
    > item: Set Variable
    > Variable=SYS
    > Value=c:\ups_thermal_2844_643c
    > end
    > item: Check Disk Space
    > Space1=5000
    > end
    > item: Set Variable
    > Variable=CMDLINE
    > Value=prnmngr.vbs -a -p "UPS2844" -m "ups thermal 2844" -r "LPT1:"
    > end
    > item: Set Variable
    > Variable=SYS32
    > Value=c:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > end
    > item: Copy Local File
    > Source=%sys%
    > Destination=%sys32%
    > Description English=Configuration files needed for Thermal UPS 2844
    > Local Path=c:\ups_thermal_2844_643c
    > Flags=0000000101100010
    > end
    > item: Execute Program
    > Pathname=cmd
    > Command Line=/c cscript.exe %cmdline%
    > Default Directory=c:\windows\system32
    > end
    >
    >
    > One more question?- What modifications will I need to make in order to
    > have
    > the other executable follow (example from the old/wrong script from below
    > Pathname=c:\ups\active x control
    >> > > Command Line=ups2442.exe /s
    > - As it is a pre-made executable-when I run it I notice it requires some
    > intervention to select NEXT at the prompts- The goal is to eliminate the
    > need
    > for user intervention by doing a silent install- I would like to include
    > it
    > in the script that I have created above at the bottom- So that it does
    > both
    > at the same time) Then I am golden!
    >
    > "SMS-Curious guy" wrote:
    >
    >> Thanks Terry- Here is the script that I used that seemed to work- I just
    >> had
    >> to change that to cscript.exe as opposed to wscript.exe
    >> item: Add Directory to Path
    >>
    >> Directory=C:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    >> end
    >> item: Set Variable
    >> Variable=SYS
    >> Value=c:\ups_thermal_2844_643c
    >> end
    >> item: Check Disk Space
    >> Space1=5000
    >> end
    >> item: Set Variable
    >> Variable=CMDLINE
    >> Value=prnmngr.vbs -a -p "UPS2844" -m "ups thermal 2844" -r "LPT1:"
    >> end
    >> item: Set Variable
    >> Variable=SYS32
    >> Value=c:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    >> end
    >> item: Copy Local File
    >> Source=%sys%
    >> Destination=%sys32%
    >> Description English=Configuration files needed for Thermal UPS 2844
    >> Local Path=c:\ups_thermal_2844_643c
    >> Flags=0000000101100010
    >> end
    >> item: Execute Program
    >> Pathname=cmd
    >> Command Line=/c cscript.exe %cmdline%
    >> Default Directory=c:\windows\system32
    >> end
    >>
    >>
    >> What does the /c switch do- call the cmd program? Where can we find a
    >> list
    >> of switches? One last question can I append the other executable that I
    >> want
    >> to run after this-How would I do that- IF you look at the old script file
    >> below it is in a local c:\ups\active x control
    >>
    >> Pathname=c:\ups\active x control
    >> > > Command Line=ups2442.exe /s
    >>
    >> Hopefully this will work just as well with Windows NT 4.0
    >>
    >> Thanks,
    >>
    >> Steve
    >>
    >> "TerryM" wrote:
    >>
    >> > Hi,
    >> > There are a couple ways to get this to work. Like just repackaging the
    >> > printer install (like registry entries, files in the right places,
    >> > etc..)
    >> >
    >> > However since you are asking about getting the command line to work we
    >> > can
    >> > do it that way too.
    >> >
    >> > From reading your script you posted there are a few things wrong that
    >> > will
    >> > need to be changed.
    >> >
    >> > First I wouldn't mess with all the path stuff, and I wouldn't try
    >> > setting a
    >> > variable sys or sys32 to something other than what they are set by
    >> > default...
    >> >
    >> > Basically all you have to do is:
    >> > a.) "install" (not copy) the vbscript and the printer setup files to
    >> > the
    >> > users hard drive.
    >> > b.) execute program this is where you are making the most mistakes.
    >> > You are
    >> > not putting anything in for the program to execute, you are just
    >> > putting
    >> > everything in as a command line. a command line is all the stuff you
    >> > put
    >> > after the name of the executable you will be executing.
    >> >
    >> > In your case I would do:
    >> > Install vbscript and files someplace like sys32 (don't need to set this
    >> > variable as it is by default)
    >> > Set variable cmdline = %sys32%\prnmngr.vbs -a -p "UPS2844" -m "ups
    >> > thermal
    >> > 2844" -r "LPT1:"
    >> > execute program:
    >> > execute path: cmd.exe
    >> > command line: /c wscript.exe %cmdline%
    >> >
    >> > let me know if you have further questions or issues.
    >> >
    >> > Terry
    >> >
    >> > "SMS-Curious guy" <SMSCuriousguy@discussions.microsoft.com> wrote in
    >> > message
    >> > news:EDFF7645-D95F-48A5-8E4B-4E31CB3AC9E9@microsoft.com...
    >> > > I need to automate installing a local printer using this dos based
    >> > command.
    >> > >
    >> > > cscript prnmngr -a -p "UPS2844" -m "ups thermal 2844" -r "LPT1:"
    >> > >
    >> > > THIS LINE WORKS LIKE A CHARM- SO I KNOW IT IS GOOD- I tested it from
    >> > > a dos
    >> > > prompt- the only thing is now I want to automate it so we don't have
    >> > > to
    >> > use
    >> > > an ADD printer wizard and do that manually for 400 machines or so.
    >> > >
    >> > > The only requirement is that it is run from c:\windows\system32
    >> > > folder.
    >> > >
    >> > > Goal- To automate installing a UPS type printer and printer driver to
    >> > > evenutually around 400 machines- They are on Win2k, XP and NT 4.0
    >> > platforms.
    >> > > The printer model is a UPS printer and it is the same model for all.
    >> > >
    >> > > I first used the oemsetup.inf file to see where it copied the files
    >> > > and
    >> > then
    >> > > I had to look inside the oemsetup.inf file to see the name of the
    >> > > driver
    >> > it
    >> > > wanted to install.
    >> > >
    >> > > Keep in mind I am an sms-installer newbie so I really couldn't find
    >> > > all of
    >> > > the functionality I wanted inside of the script editor but you get
    >> > > the
    >> > jist-
    >> > > when I try to run this script the only thing it complains about is
    >> > > that it
    >> > > cannot run the external program and the cscript prnmngr line. I
    >> > > stuck the
    >> > > cmd in front so that it would open dos first it hoping that it would
    >> > change
    >> > > things- but no such luck.
    >> > >
    >> > > Ok here is the script I made:
    >> > > item: Add Directory to Path
    >> > > Directory=c:\windows\system32
    >> > > end
    >> > > item: Add Directory to Path
    >> > >
    >> > > Directory=C:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    >> > > end
    >> > > item: Set Variable
    >> > > Variable=SYS
    >> > > Value=c:\ups_thermal_2844_643c
    >> > > end
    >> > > item: Set Variable
    >> > > Variable=SYS32
    >> > >
    >> > > Value=c:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    >> > > end
    >> > > item: Check Disk Space
    >> > > Space1=5000
    >> > > end
    >> > > item: Copy Local File
    >> > > Source=%sys%
    >> > > Destination=%sys32%
    >> > > Description English=Configuration files needed for Thermal UPS 2844
    >> > > Local Path=c:\ups_thermal_2844_643c
    >> > > Flags=0000000101100010
    >> > > end
    >> > > item: Execute Program
    >> > > Command Line=cmd cscript prnmngr -a -p "UPS2844" -m "ups thermal
    >> > 2844" -r
    >> > > "LPT1:"
    >> > > Default Directory=c:\windows\system32
    >> > > end
    >> > > item: Execute Program
    >> > > Pathname=c:\ups\active x control
    >> > > Command Line=ups2442.exe /s
    >> > > Default Directory=c:\ups\active x control
    >> > > Flags=00001010
    >> > > end
    >> > >
    >> > > Ideally I would like to have another executable run after the first
    >> > > part
    >> > of
    >> > > the command line- That is an active x software installer and it is
    >> > > already
    >> > an
    >> > > executable- so that part should not be a problem. Any thoughts- on
    >> > > how I
    >> > > might be able to get this package to work? Also if there was a way
    >> > > to
    >> > take a
    >> > > snapshot of an entire's machine setup with smsinstaller that would be
    >> > > good
    >> > > but I am not sure about those details so if anyone has any info or
    >> > > can
    >> > help
    >> > > me with this project I would appreciate it- there has to be a way to
    >> > > do
    >> > this.
    >> >
    >> >
    >> >


  • Next message: SMS Newbie in the Block: "SMS Client Agent will not install completely"

    Relevant Pages

    • Cross-platform install - searching for a method (without java)
      ... Can interact with the system - that is, execute native ... Essentially, I had the idea of using Perl, sans-modules, ... Put the minimum I need to run a perl script into the ... it and kick off the real install script. ...
      (comp.programming)
    • Re: Basics - Installing Applications
      ... I am a newbie using Linux ... then I tried AMSN and still have not be able to install it, ... > some other script that will install it automatically. ... > type the filename in to execute. ...
      (comp.os.linux.setup)
    • Re: Installing a CPAN Module online
      ... I did manage to install the module without using Make. ... I was also able to get some advice as to how I might use a shell script to execute Make in the future. ... It sounds as if you have an account without shell access, and that you are thinking of writing and uploading a CGI script that would install the module for you. ...
      (comp.lang.perl.modules)
    • Re: SNMP Service Installation
      ... I tested the solution but, when I execute the script, it asks for the new ... >> I need to install the SNMP service on about 500 Pcs already configured. ... >> Is there anybody who can give me any suggestion with SMS or other ...
      (microsoft.public.sms.swdist)
    • Re: Will Linux become as vulnerable as MS ??
      ... > beeing vulnerable to viruses. ... > that they know are executable, and execute intentionally. ... >> Linux, each distro is a little different, and even within the distro, ... > Since clicking on a script is easier than typing it's name, ...
      (comp.os.linux.security)