RE: Using SMS to install network printers



Without an error I can't know for sure, but a couple of possible things:

- When it spawns it has to have appropriate rights. I usually run these
directly so they run with the rights from SMS. You might try advertising the
client from SMS and allow it to download the package, then go into the
directory from a command line and run the batch file. If it runs as you, it
might be a rights issue.

- It might not be able to find the xxx.vbs, but the above test should also
answer that one for you.

-- You can try cscript scriptname.vbs >> c:\output.txt and see if you get
any output from it. You might have to tweak your script a bit for error
catching, but this will help if it is running the script but it doesn't
appear to do anything.

-- I've also pushed them and put a pause in them and then checked program
manager to see if they are running.

If you're able to capture the error though I'm sure it is something easy to
fix.

Any reason you don't want to run the vbs directly from SMS? IE: Is the
batch file doing other things as well?

Jason

"Gareth" wrote:

> Tried that one, but with no luck.
>
> This is what i tried
>
> cscript SCRIPTNAME.VBS
>
> Any ideas??
>
>
> Gareth
>
> "JRM" wrote:
>
> > Well, in general you could just have a batch file that has a line
> > cscript filename.vbs
> >
> > If you go to the DOS prompt of most systems just typing cscript will give
> > you all the various flags that go along with it. Cscript is the version that
> > runs from a command prompt - but the same scripts will run from both unless
> > you use specific functions like wscript.echo, etc.
> >
> > I don't think you should have any problems with Win2k or WinXP - and I think
> > cscript even goes all the way back to Windows 98. If that doesn't look like
> > it would work for you - just let me know what reasons prevent you from
> > running the vbs directly and that might help me give a better answer.
> >
> > Thanks
> >
> > Jason
> >
> > "Gareth" wrote:
> >
> > > Thanks, i have managed to write a VBS script of the below which connects the
> > > users to a networked printer (found it on another post somewhere).
> > >
> > > You would not happen to know how to execute a VBS script from a BAT file
> > > would you?? This is my next challenge
> > >
> > > Thank you for you time in replying
> > >
> > > Gareth
> > >
> > > "JRM" wrote:
> > >
> > > > I'm sure there are several ways, but one way you could do it is via WSH.
> > > >
> > > > We use a WSH script for our login script, and it installs printers for users
> > > > based on their OU. The same sort of thing would probably work as an SMS
> > > > package as well:
> > > >
> > > > Set WSHNetwork = WScript.CreateObject("WScript.Network")
> > > > WSHNetwork.AddWindowsPrinterConnection "\\printserver\printer-name"
> > > > WSHNetwork.removePrinterConnection "\\printserver\printer-name"
> > > >
> > > > http://www.microsoft.com/technet/scriptcenter/scripts/printing/servers/default.mspx
> > > >
> > > > Hope that helps.
> > > >
> > > >
> > > >
> > > > "Gareth" wrote:
> > > >
> > > > > Hello
> > > > >
> > > > > Is it possible to install printers that are installed on a print server via
> > > > > SMS 2003?
> > > > >
> > > > > I have a couple of hundred client computers that need connections to
> > > > > networked printers and this could save me time
> > > > >
> > > > > Thanks
> > > > >
> > > > > Gareth
.



Relevant Pages

  • Re: Slow string
    ... Cscript is the default. ... In a batch file, % followed by a number represents arguments used on the commandline launching the batch file. ... If you run the script by just issuing the command "demobatch", Here's what special expansions would give you: ... There are multiple ways to do this, of course, but they all are similar and this particular form works correctly without breaking, even if you happen to run a script with more than 9 commandline arguments, and needs no internal editing even you later rename the script files to something else. ...
    (microsoft.public.scripting.vbscript)
  • Re: Slow string
    ... Cscript is the default. ... In a batch file, % followed by a number represents arguments used on the ... commandline launching the batch file. ... provided to the original script. ...
    (microsoft.public.scripting.vbscript)
  • Re: doesnt finish
    ... You appear to mix VB Script and batch file syntax freely. ... The single quote is used in VB Script files to denote a comment. ... cscript //nologo MakeFile.VBS ... goto:eof ...
    (microsoft.public.scripting.vbscript)
  • Re: Anything run by GP runs with elevated permissions?
    ... I know that if I deploy a software MSI package via GP that it will install with elevated privileges. ... Say I want to simply execute a batch file that attempts to copy a file into system32 that the currently logged in users would not have rights to do. ... Or a script that edits a part of the registry that the user does not have rights to. ...
    (microsoft.public.windows.group_policy)
  • Re: run scripts with administrative rights
    ... under the context of the local system. ... rights and permissions that it needs. ... Are you talking about a logon script that is executed when a user logs on? ... > i have a script that will run a batch file, ...
    (microsoft.public.win2000.active_directory)

Loading