Re: sms installer- automate installing local printer
From: TerryM (terry_at_nospam.com)
Date: 11/08/04
- Previous message: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- In reply to: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- Next in thread: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- Reply: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- Messages sorted by: [ date ] [ thread ]
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.
>> >
>> >
>> >
- Previous message: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- In reply to: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- Next in thread: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- Reply: SMS-Curious guy: "Re: sms installer- automate installing local printer"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|