Print script to kill citrix cp

matt_B_2008
matt_B_2008 used Ask the Experts™
on
Im using the following script to kill the citrix auto creation service each evening. I found that some of the servers are still running the scheduled task in the morning because when it has run the script it is asking for a prompt. Bit strange as others servers running the same script run without prompt.

Any ideas?

TASKKILL /F /IM "cpsvc.exe"

net stop spooler

net start spooler
net start cpsvc
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Daniel BorgerSenior Citrix Engineer- CCEE

Commented:
check the account the sceduled task is set to run as. Could be permissions to execute command.

Author

Commented:
accounts fine, it runs if you say yes, its just i dont understand why its prompting?

Author

Commented:
I can run it manually so it suggests that account is fine. Problem is the prompt then stops net logon from running.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Daniel BorgerSenior Citrix Engineer- CCEE

Commented:
But unless you are logged in all the time, what account is the task running under when you are not logged in?
Daniel BorgerSenior Citrix Engineer- CCEE

Commented:
try running with the /f switch at the end....
taskkill /IM notepad.exe /f
Daniel BorgerSenior Citrix Engineer- CCEE

Commented:
make sure its' a .com file and not a .bat also you could recreate the .com file and make sure you save it as ANSI for the type.

Author

Commented:
Thanks dborger, do you think this is a worthwhile practice (restarting citrix print manager and spool) each evening?
Senior Citrix Engineer- CCEE
Commented:
I think rebooting the servers would give the same results as well as freeing up virtual memory.  Some companies use nightly reboots as a preventative maintence practice.  For me, that's okay but if it got to the point that I needed to do it I would be concerned. If you are having printing issues that require this type of remedy perhaps it makes sense to take a step back and determine the root cause. There are tons of posting here about printing best practices and steps to troubleshoot and unstable print enviroment. for the most part it always comes back to the print drivers being used. limit them to native if you can, use the UPD for anything you can, delete drivers that are not needed from the servers and use policies to ensure the drivers do not come back. That means RDP as well. Admins logging into the console will add drivers to the server without even knowing it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial