PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > Using VBScript for logon scripts rather than BAT files
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Using VBScript for logon scripts rather than BAT files

Réponse
 
LinkBack Outils de la discussion
Vieux 24/11/2007, 14h44   #1
Laphan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Using VBScript for logon scripts rather than BAT files

Hi All

It seems to be that using VBscript files are better (more reliable??) than
BAT files when it comes to adding/removing/setting default printers - is
this the case?

Due to the blessed HP2600N printer I've had to install this printer manually
on each PC rather than pushing it via GPO logon scripts, but when the other
printers get pushed through to each user account via GPO they take the
default printer status away from my locally installed HP2600N printers -
there anyway I can correct this in a BAT file or do I have to go the VB
script route?

It's just that I don't know how to do certain things like move files about
and map drives in VBScript so it would be nice if there was a simple command
in the BAT file configs that would allow me to set my chosen local printer
as the default.

Thanks

Laphan


  Réponse avec citation
Vieux 24/11/2007, 15h55   #2
Pegasus \(MVP\)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Using VBScript for logon scripts rather than BAT files

See below.

"Laphan" <admin@DontSpam.com> wrote in message
news:%23YsYIiqLIHA.280@TK2MSFTNGP03.phx.gbl...
> Hi All
>
> It seems to be that using VBscript files are better (more reliable??) than
> BAT files when it comes to adding/removing/setting default printers - is
> this the case?


*** No, the quality of the script depends on its author, not
*** on the language.

> Due to the blessed HP2600N printer I've had to install this printer
> manually
> on each PC rather than pushing it via GPO logon scripts, but when the
> other
> printers get pushed through to each user account via GPO they take the
> default printer status away from my locally installed HP2600N printers -
> there anyway I can correct this in a BAT file or do I have to go the VB
> script route?


*** You can do it either way. In a batch file the command would be
*** rundll32 printui.dll,PrintUIEntry /y /n \\<server>\<printername>
*** In a script file it is a little more involved (and far more versatile!).

> It's just that I don't know how to do certain things like move files about
> and map drives in VBScript so it would be nice if there was a simple
> command
> in the BAT file configs that would allow me to set my chosen local printer
> as the default.
>
> Thanks
>
> Laphan
>
>



  Réponse avec citation
Vieux 26/11/2007, 04h01   #3
Thom Paine
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Using VBScript for logon scripts rather than BAT files

> It's just that I don't know how to do certain things like move files about
> and map drives in VBScript so it would be nice if there was a simple
> command
> in the BAT file configs that would allow me to set my chosen local printer
> as the default.



I do this all the time. I set the mappings with the batch file, and then the
last line is to call a vb script file to load printers.

I'm slowly working up to tricks like setting a default printer based on the
computer they are logging on to, but for now I have different groups call a
different script for the printer.

Here is an example of mine.

logon.bat
REM
net use n: \\pdc-scps-2006\distributor
net use i: \\pdc-scps-2006\schedule
net use s: \\pdc-scps-2006\shared
net use t: \\pdc-scps-2006\forms
net use u: \\pdc-scps-2006\policies
net use q: \\pdc-scps-2006\court
call \\pdc-scps-2006\netlogon\logon.vbs


logon.vbs
ON ERROR RESUME NEXT
Dim net
set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\pdc-scps-2006\dispatch"
net.AddWindowsPrinterConnection "\\pdc-scps-2006\1720disp"
net.AddWindowsPrinterConnection "\\pdc-scps-2006\admincolour"
net.SetDefaultPrinter "\\pdc-scps-2006\dispatch"

If you leave the last line off, the set default printer, I think the default
printer of the local pc one will stay, but YMMV.

-=/>Thom


  Réponse avec citation
Vieux 28/11/2007, 17h14   #4
Nex6
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Using VBScript for logon scripts rather than BAT files

I have all my logon scripts in vbscript. it makes things very easy, once you
template everything out.

-Nex6

"Laphan" <admin@DontSpam.com> wrote in message
news:%23YsYIiqLIHA.280@TK2MSFTNGP03.phx.gbl...
> Hi All
>
> It seems to be that using VBscript files are better (more reliable??) than
> BAT files when it comes to adding/removing/setting default printers - is
> this the case?
>
> Due to the blessed HP2600N printer I've had to install this printer
> manually
> on each PC rather than pushing it via GPO logon scripts, but when the
> other
> printers get pushed through to each user account via GPO they take the
> default printer status away from my locally installed HP2600N printers -
> there anyway I can correct this in a BAT file or do I have to go the VB
> script route?
>
> It's just that I don't know how to do certain things like move files about
> and map drives in VBScript so it would be nice if there was a simple
> command
> in the BAT file configs that would allow me to set my chosen local printer
> as the default.
>
> Thanks
>
> Laphan
>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h10.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10329 seconds with 12 queries