Link to home
Start Free TrialLog in
Avatar of Axis52401
Axis52401Flag for United States of America

asked on

Can I make login script actions hidden

I set up a login script .bat file to map network drives and install some shared printers because the users keep deleting them. It works but as the user logs in they see the CMD window and then it opens each printer's Window (not sure what its called I attached a screen shot) Then it dissappears. Now they're complaining they don't want to see this. Is there any way to get the script to work yet not display anything on their screens just map the drives and printers in the backgound
printer.doc.docx
ASKER CERTIFIED SOLUTION
Avatar of Trenton Knew
Trenton Knew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Kline
Test this GPO

User Configuration | Administrative Templates | System | Scripts

GPO = Run legacy logon scripts hidden

Have you looked at group policy preferences for some of this?  Just for down the road.

Thanks

Mike
Avatar of Axis52401

ASKER

What do you mean by make the script run as the system account? I have a/bat file on the server Sysvol\domain etc and in the user profile it set to use that file. I don't want to have to go to each station an create a task on each PC

I Tried that setting in the GP either I did it wrong or Its not applying because after running gpupdate on the test PC i'm using I still see the cmd window and printer popups. If I could even get the login script batch file to skip everything if its already mapped that might work too but I don't know the dos commands to do that. that way it would only happen once for each user not every time
Avatar of Trenton Knew
Trenton Knew

might also be an idea to recreate the printers at logoff instead of logon.  That way the printers dialog never becomes an issue as the machine "preps" itself for the next user when the last user logs off.

There might also be a group policy setting that disallows the deletion of printers.
if you run the .bat file via the task scheduler, you can specify which user account to run the script as.  If you run the script under NT_AUTHORITY\SYSTEM the user will not see the bat file run, nor will the printer window pop up (I think).
How do I set it to run via the task scheduler? Its worth a try
Try this vbs script and apply the logon policy to map the drive.I have applied many times this does not prompt for printer windows.Save the file as filename.vbs,copy the file to sysvol share(script folder) and apply the logon policy.


Dim multiPrinter, UNCpath1, UNCpath2, UNCpath3, UNCpath4, UNCpath5
UNCpath1 = "\\server01\printer1"
UNCpath2 = "\\server01\printer2"
UNCpath3 = "\\server01\printer3"
UNCpath4 = "\\server01\pinter4"
UNCpath5 = "\\server01\printer4"
Set multiPrinter = CreateObject("WScript.Network")
multiPrinter.AddWindowsPrinterConnection UNCpath1
multiPrinter.AddWindowsPrinterConnection UNCpath2
multiPrinter.AddWindowsPrinterConnection UNCpath3
multiPrinter.AddWindowsPrinterConnection UNCpath4
multiPrinter.AddWindowsPrinterConnection UNCpath5
multiPrinter.SetDefaultPrinter UNCpath1
WScript.Quit

Alternately you can apply  GP Preferences to map printer but for WinXP you need to install Client Side Extensions for Windows XPhttp://www.microsoft.com/en-in/download/details.aspx?id=3628: http://blogs.technet.com for policy to work:

 GP Preferences to map printer ;http://blogs.technet.com/b/grouppolicy/archive/2009/06/24/gp-preferences-set-a-default-printer.aspx