Avatar of Pkafkas
Pkafkas

asked on 

How to set the default printer with a batch file in a roaming profile?

Hello:

We have a Windows AD network at my work.  We have local profiles for PC's and laptops; but we use roaming profile when users logon to Citrix Farm.  The roaming profiles are created in the Remote Desktop Services profile tab, in Active Directory.  The Citrix Farm Servers are Windows 2008 R2 Sp1.

One user is having a problem with his default printer continuously changing on him.  I think that his local printer is for some reason not keeping the normal default printer and it randomly puts another printer as the default.  Then the said users logas on via Remote Desktop and his remote desktop default printer is this other printer.

I am thinking of creating a batch file on the user's laptop (startup folder) to select the desired printer to always be his default.

put in the c:\ProgramData\Microsoft\Windows\Start Menu\programs\Startup, on the user's Windows 7 laptop.

REM Set printer as default
rundll32 printui.dll,PrintUIEntry /y /n\\Printer_Server_Name\Printer_Share_Name


But is there a way to force the default printer to be set after the user logs on to the Citrix Server?  Can I put the same batch file on the Citrix Server's local profile settings, for this user?  Perhaps put a delay of 10 seconds in order to wait for all of the printers to load first and then execute the batch file?
CitrixPrinters and ScannersWindows Server 2008

Avatar of undefined
Last Comment
Pkafkas
Avatar of Pkafkas
Pkafkas

ASKER

Could it be in:  C:\Users\UserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs - folder

How can I put a delay in the batch file?

Should I use a sleep command?  http://www.robvanderwoude.com/wait.php  //sleep does not seem to work.  Any other commands that can pause the execution of the batch file?

sleep 20
rundll32 printui.dll,PrintUIEntry /y /n\\COMPUTER\PRINTER
ASKER CERTIFIED SOLUTION
Avatar of Pkafkas
Pkafkas

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Pkafkas
Pkafkas

ASKER

No one replied and I figured this out myself.
Windows Server 2008
Windows Server 2008

Windows Server 2008 and Windows Server 2008 R2, based on the Microsoft Vista codebase, is the last 32-bit server operating system released by Microsoft. It has a number of versions, including including Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, Itanium and Storage; new features included server core installation and Hyper-V.

86K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo