We help IT Professionals succeed at work.
Get Started

Print PDF as custom service SBS2008

deibel
deibel asked
on
728 Views
Last Modified: 2012-05-11
Hi Experts,

I need your advice!

I want to print a PDF from a SBS2008 periodical once a day.
The PDF is created by another application and saved in a local folder.
This little "printservice" has to run in background with no user activity an also with no user logged into the machine.

I wrote a batchfile and configured the taskplaner to execute it.
but that doesnt work with no user logged into the machine.

so i thought i need a custom service and created one with srvany.exe
i modified the batch to an infinite loop
but that didnt work either.

This is my batchfile:
:START
start runas /profile /savecred /user:sysadmin@domain.local "C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe /p /h c:\test\Test.pdf"
@time /T>> c:\test\test.txt
timeout /T 300
Taskkill /F /IM acrord32.exe /T

goto START

I saw, that no printer is given as argument to AcroRd32 /p so i thought it only prints to the default printer. But there is no default printer, when no user is logged in. So I tried runas with no effect.

I googled a bit an read somthing about missing rights. But I dont really understand that.

Can anybody give me an advice?

Thanks in advance
Comment
Watch Question
Top Expert 2011
Commented:
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE