Re: sms installer- automate installing local printer

From: SMS-Curious guy (SMSCuriousguy_at_discussions.microsoft.com)
Date: 11/08/04


Date: Mon, 8 Nov 2004 05:58:02 -0800

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.
>
>
>



Relevant Pages

  • CGIscript.net - csMailto.cgi - Remote Command Execution
    ... CGIscript.net - csMailto.cgi - Remote Command ... csMailto is a perl cgi formmail script developed by ... execute command on server and mail output to anyone ...
    (Bugtraq)
  • Re: shell scripting
    ... and am assuming an sh-compatible shell here.... ... command 1 options arguments ... To run the script, do: ... then you need to use the full path to execute it: ...
    (comp.unix.shell)
  • Re: shell scripting
    ... and am assuming an sh-compatible shell here.... ... command 1 options arguments ... To run the script, do: ... then you need to use the full path to execute it: ...
    (comp.unix.questions)
  • =?iso-8859-1?Q?Re:_Jcl?=
    ... I can send you a program that you execute as a step in your job and it ... I have a command and job scheduler that is available in a free version ... demand script processor with the full scripting ability so that your job ...
    (bit.listserv.ibm-main)
  • Re: sms installer- automate installing local printer
    ... printer install ... However since you are asking about getting the command line to work we can ... execute program this is where you are making the most mistakes. ...
    (microsoft.public.sms.installer)