When you run the batch file through a scheduled task are you running it as SYSTEM or as the user? If you are running it as SYSTEM then it will not set the default printer for any other user. Setting the Default Printer is something that must be done as the user.
Yes, now I know that that, my package (batch) is running as a local system.
If I select user's account, the user has to be loged in, but I dont want that.
Other thing that I got from LD support was this. It is useing .vbs. Does anyone tried soemthing like this?
var WshNetwork = WScript.CreateObject("WScript.Network"); var PrinterPath = "\\\\research\\library1"; WshNetwork.AddWindowsPrinterConnection(PrinterPath); WshNetwork.SetDefaultPrinter(PrinterPath);
this is the link just in case someone wants to know more about it.:
Thank you for your answers guys. I really appreciate your help.
Well, If you are using Local System, then you will not be able to set a user's default printer without doing some more work. The Default Printer is set for each user so doing it the way you are doing it will only set the default printer for the system account which is not what you want.
You can break this into two jobs (one to install the printer, one to set the default printer that you run as user) or you could use some other mechanism to set the default printer. I personally use Active Setup to this type work. If you are not familiar with Active Setup, see the following article: http://www.appdeploy.com/articles/activesetup.asp. The article talks about running msiexec for each user to repair a msi package, but you could also have it running a vb script, batch file, other exe file, etc.
Awesome, Thanks for the Link Ernie
The other way would be :
use this deliver method : Install at next login distribution
description : Once package is downloaded, its installation will be delayed until the next user login.
I will try everything and see what is good in our enviroment
Thank all of you guys.
Your method would also work except for the case where you need to set the default printer for multiple users. In that case Active Setup is the best way to get the default set for anyone who logs in.