Thumbnail generation in windows service

I try to create thumbnails for pdf files using the microsoft windowns 7 api codepack.
If I use this code from a normal desktop application everything works fine.
But if I use it from a windows service, to create thumbnails for our document manager, I get the folowing Exception:
System.NotSupportedException: The current ShellObject does not have a valid thumbnail handler or there was a problem in extracting the thumbnail for this specific shell object. ---> System.Runtime.InteropServices.COMException: Klasse nicht registriert (Ausnahme von HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
With Word and Excel files it also works inside the windows service, so I think its a problem with Acrobat Reader.
What can I do to fix the problem?

I think section 3.2 of the Adobe Reader license agreement means that the technical failure is not relevant. http://wwwimages.adobe.com/content/dam/Adobe/en/legal/licenses-terms/pdf/Reader_11.0.pdf page 86

Similar Messages

  • Adobe Reader XI (11.0.08) doesn't create thumbnail (bitmap) using Microsoft Interface IExtractImage -- Extract on Windows Server 2008 R2, when exe to generate thumbnail is launched from Windows service.

    Adobe Reader XI (11.0.08) doesn't create thumbnail (bitmap) using Microsoft Interface IExtractImage --> Extract on Windows Server 2008 R2, when exe to generate thumbnail is launched from Windows service.
    But if exe is launched as standalone, then interface IExtractImage --> Extract, gives Bitmap to generate thumbnail of PDF document.
    Above problem occurs only for PDF documents, if we tried same with other software like CAD -CATIA it works without any problem.
    Is there any security concerns form PDF side, which doesn't allow to generate Bitmaps, if exe to generate it is launched form Windows service.

    It might be deliberate, Acrobat and Reader software is not intended to run in a service environment.

  • PDF thumbnail generation has stopped working

    Hello Together,
    formerly I was using Adobe Reader X at an actual Patch Level on a 64 Bit Windows 7 system. At that time PDF thumbnails were no subject for me. Now I've upgraded to Adobe Acrobat X Pro and uninstalled Adobe Reader X. Then I wanted to use the thumbnails. That was no problem as I found a link to a tool which fixed my issue: http://forums.adobe.com/thread/305220
    Everything worked fine for me, until I noticed that one of my applications needed an installed Adobe Reader to work properly. So I reinstalled the Adobe Reader on my system again. This caused to stop the thumbnail generation: PDF files which existed prior to the Adobe Reader installation still have a thumbmail icon preview, but those who were generated after the installation still appear as a PDF icon.
    Before installation the fix from thread 305220 my workaround was to open Acrobat X, the navigate to the open dialog, moving to the folder with the PDFs within and wait that Acrobat finished the thumbnail generation. But this workaround now is out of service, too. So my assumption is, that reinstalling Adobe Reader screwed up something in my Adobe installation which I cannot find at the moment which has nothing to do with the initial problem with displaying thumbnails.
    Performing some repair installation didn't help:
       (1) repair Adobe Reader, then repair Adobe Acrobat --> no change
       (2) repair Adobe Acrobat, then repair Adobe Reader --> no change
       (3) repair Adobe Reader only --> no change
       (4) repair Adobe Acrobat only --> no change
       (1), then apply fix from thread 305220 --> no change
       (2), then apply fix from thread 305220 --> no change
       (3), then apply fix from thread 305220 --> no change
       (4), then apply fix from thread 305220 --> no change
       apply fix from thread 305220, then (1) --> no change
       apply fix from thread 305220, then (2) --> no change
       apply fix from thread 305220, then (3) --> no change
       apply fix from thread 305220, then (4) --> no change
    I hope, that I'm not the only one who got this problem and, hopefully, someone found a solution for this.
    Regards
       TheCuriousOne

    Loreto María wrote:
    My IPod nano 2nd Generation, has stopped working, it gets frozen and I get a message telling to go to "www.apple.com/support" but I cannot get any support there, anyone knows if It can be repaied. Thanks a lot in advance. Regards. Loreto
    Why not?
    Did you at least download & read the user manual?
    You can always call Apple Care if you are still under warranty.  Otherwise, take your iPod to an Apple Store or an AASP.

  • Thumbnail Generation Logic is weird?

    I have been spending some time on Aperture for the last couple of days with Trial version 2.1. As you know, if thumbnail is not generated (and cached of course) for an image, Aperture will show a fuzzy/blurred image in Browser Mode, and that will get clear as Aperture generates the thumbnail. As far as I can see here is how thumbnails (rendering/generation/caching) work on Aperture:
    1. Aperture has some kind of a "smart" algorithm (which really is not that smart at all, at least for me) to select candidates for thumbnail generation (will go into this a bit more below)
    2. Menu option: Images -> Generate thumbnails is quite useless in that it does not care what images you select (almost none) if you select more than 5-10 images. For example, select 500 images and hit Images->Generate thumbnails, it ignores what you selected and goes with its own selection algorithm. Having said that, selected images might have some kind of an influence on this, but it definitely does not render it for all 500 images, e.g. it will render 10-20 images around the current window...
    3. "Smart" selection algo is not that smart I said, because it tries to select images around what you are viewing, but keep failing to do so. For example, in brower only window, hit page down couple of times, and it starts generating thumbnails for a few items on the current window/view pane, but not all!... So, it ends up generating thumbnails for like 3-4 only out of 20, and you end up with a page that has 80% broken thumbnails, 20% properly generated ones.
    4. For the 80% in (3), you click on one of the images, then it starts rendering/generating the thumbnail for that particular image. Sometimes it does this in batches, e.g. you click on one and it renders that one, the one on the left and right as well, but sometimes only the one you clicked.
    5. Sometimes for the same 80% in (3), you select a few images and it renders these as you select them. Sometimes it just does not. If it does not, you can hit Generate Thumbnails and it will generate it for the few.
    6. What is even weirder is that, for the 80% in (3), you select some images, and it does nothing. But, then you change the focus (e.g. alt+tab to a different window) and come back to Aperture, and it will start rendering...
    All in all, it is quite annoying to have inconsistent behavior like this, and the fact that Generate Thumbnails is useless is something I find really stupid! If it is there, it should work, if it is not intended to what it does, you should remove it...
    I am soo ready to buy Aperture, but this thumbnail generation stupidity and constant fight with Aperture to get proper thumbnails is driving me nuts...

    I really need to use a program that allows call via command line as ImageMagick to use it in an application .Net, I can generate the thumbnails with Illustrator CS5 files, but can not generate from Illustrator CS6 files, this error only appears with files from CS6, as if you know help me thank you.
    Already gratefully,
    Miranda

  • Call to Table.SetDataSource() causes FileLoadException in Windows service

    I'm porting code toVS2010/Crystal Reports VS2010 that has worked flawlessly 24/7 for the past 2 years.  Original code used VS2008/CR VS2008.
    I generate reports from a background Windows service using Crystal Reports.  I have a set of report generation CR components that work in a variety of contexts - WinForms apps, console apps and the Windows service.
    When I ported to VS 2010, all of my apps worked fine, except for the Windows service.  In the service, the first call to Table.SetDataSource() causes the service to crash.  I've used detailed logging in the service to pinpoint the source of the error.  I log before and after the call to SetDataSource(), but only the before message is logged.
    VS2010 version - 10/0/30318.1 RTMRel
    CR VS2010 runtime version - 13.0.2000.0
    I see the following in the 'Application' event log after this happens:
    =======================
    EventType clr20r3, P1 usastudiosservice.exe, P2 1.0.4065.17651, P3 4d5d3537, P4 mscorlib, P5 4.0.0.0, P6 4ba1da6f, P7 2463, P8 0, P9 system.io.fileloadexception, P10 NIL.
    =======================
    Application: UsaStudiosService.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.IO.FileLoadException
    Stack:
       at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
       at System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Threading.StackCrawlMark ByRef, Boolean, Boolean)
       at System.Reflection.RuntimeAssembly.InternalLoadFrom(System.String, System.Security.Policy.Evidence, Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
       at System.Reflection.Assembly.LoadFrom(System.String)
       at CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.DataSetProcessingDelegate(IntPtr)
    ======================
    I'm catching all exceptions in my report generator component, but, for some reason, this exception isn't caught.  I think it's because it's occurring in the CLR and the CLR is aborting the process.
    I've been monitoring the service in ProcMon. I see a final set of  references to the CrystalDecisions.ReportAppServer.DataSetConversion assembly that succeed, 3 attempts to access the assemby's PDB file that fail, and then DW20.EXE (C:\Program Files\Common Files\Microsoft Shared\DW\DW20.EXE) is loaded to process process the error.  (Could the missing PDB file be the problem?)
    The ProcMon trace looks entirely different when I run the report gen components from the WinForms and console apps.
    I don't think this is a permissions issue.  I've been able to log in as the user that the service logs in as and have been able to run both WinForms and console versions of the report generator without problems.
    Any help would be greatly appreciated. I absolutely have to convert this app!
    -David

    Sorry about that,
    They changed the info... Do this:
    In the mean time here's how to work around it and get logging working:
    Create a Registry file with this in it and save it: ( Replace the double quote with an open square bracket )
    W i n d o w s R e g i s t r y E d i t o r V e r s i o n 5 . 0 0
    " H K E Y _ L O C A L _ M A C H I N E \ S O F T W A R E \ S A P B u s i n e s s O b j e c t s \ S u i t e X I 4 . 0 ]
    " H K E Y _ L O C A L _ M A C H I N E \ S O F T W A R E \ S A P B u s i n e s s O b j e c t s \ S u i t e X I 4 . 0 \ C r y s t a l R e p o r t s ]
    " C o m m o n F i l e s " = " C : \ \ P r o g r a m F i l e s \ \ S A P B u s i n e s s O b j e c t s \ \ C r y s t a l R e p o r t s f o r . N E T F r a m e w o r k 4 . 0 \ \ C o m m o n \ \ "
    And then:
    1. Copy the crlogger.dll from the CR win32_x86 directory to a folder which its path length is short than 130 characters.
    2. Add the following registry key to registry:
    "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports]
    3. Add a string value u201CCommonFilesu201D under the above added registry key with the value as the pathu2019s fullname which folder we drop the crlogger.dll in step #1 (requires to include the ending backslash character u201C\u201D in the path name).
    For example, copy the crlogger.dll form the default CR win32_x86u2019s folder:
    C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\
    into:
    C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\
    Then import the .reg file you created from above.
    Thanks again
    Don

  • Windows service of WWI server doesn't start

    Hello all,
    I'm installing a WWI generation server (EHSWWI32_26-20000084 on a Windows Server 2008 R2(SP1)) for ECC 6.0.
    Now I have a problem with starting windows service.
    I installed WWI in the following path.
      E:\EHS\WWI
    Word version is 2003.
    The installation (CGSADM) is finished without problem, and the management server works fine.
    But service EHS_WWISRV, which is a service of wwi generation server, fails to start with following messages.
    <event log 1>
    The initialization process for the EHS_WWISRV_ST1_ST1_01 service failed.  Switching Desktop for Word failed!
    <event log 2>
    WWI started at: 08/03/11 10:48:37 as PID: 1132
    Initialisation........start
    Working dir is: E:\EHS\WWI
    Current PATH is: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\EHS\WWI
      Attaching service to desktop winsta0 / default
        session: 0
        window station: Service-0x0-e34639$, desktop: Default
    Error opening window station winsta0
    Windows-Error 5 in SetDesktop/OpenWindowStation: (null)
    Error setting window station winsta0
    Windows-Error 6 in SetDesktop/SetProcessWindowStation: (null)
    Error Attaching service to desktop winsta0 / default
    I have no idea what "Switching Desktop for Word failed!" means.
    Does anybody know how to fix the error?
    Thank you in advance for your support.
    Regards,
    Kazuma

    I could fix the error.
    SAP Note 580586 helped me.
    WWIUSER wasn't a member of the administrators group, and that caused the error.
    Thanks all.

  • Aperture thumbnail generation forever

    Hello
    I like to have all my pictures in one place to share them with apple tv, so I decided to give aperture a try.
    I imported all images (about 36000 from 12 years) into one aperture library.
    Before importing I switched off face detection and preview generation.
    After finishing I had a 236 GB library, but aperture starts to generate some thumbnails.
    Problem is, it freezes on generating them.
    I used the activity window to hunt down what is happeing and found out that it stops when it comes to a specific picture.
    So I managed to
    1) start aperture
    2) open activity window
    3) stop the thumbnail generation when it starts
    4) delete the picture where the aperture have problems
    This way I managed to get from about 5700 thumbanisl to do to a number of 3500 thumbnails to do, but aperture keeps freezing at a single pic (the bad one)
    But now, aperture starts thumbnail generation so quickly that I cannot open activity window and stop the progress before it reaches the bad one.
    @Apple: could we have an option like "safe start" that won't schedule any processes for thumbnails before the user wants it?
    So, any ideas out there? I tried everything I found like repairing, rebuilding, no help.
    Is there any kind of log to look into? I am a newbie in mac os and aperture.
    Regards
    Klaus

    This "bad" one is a video, some of the former bad ones were videos too, so does aperture have a problem in general with video files? Maybe its a good idea to just import all pictures and do the videos in a separate step afterwrds? Otherwise with 36000 pics (and about 300 videos between them) this is tedious...
    Klaus,
    Aperture may have a problem with videos, if you have a problematic video codec installed, if the video is corrupted, or incompatible with Aperture. What kind of videos did you import?
    If you can, delete the whole project, so that you do not need to select the video and reimport only the image files.
    Check, if you have the 3ivxVideoCodec installed - if yes, remove it,
    see: Aperture 3: May be unresponsive or have slower performance with third-party video codec
    This codec could have been installed for example by FlipForMac.
    If you do not want to delete all of your last import, you could try to delete the bad video directly from the Aperture library package:
    Quit Aperture. Ctrl-click the Aperture library and select "Show Package Content" from the pop-up menu. Open the "masters" folder and navigate to the Year-Month-day of your last import. If you can find the video there, remove it, but don't change anything else. Afterwards the video should show as missing. Delete the version from the library. The dates in the Library package are based on "Import session", not capture dates.
    Before manipulating the Library, make sure you have a current backup.
    Regards
    Léonie
    A list of supported videos is here, but it is not exhaustive:
    Aperture 3: About Video and Audio formats in Aperture

  • AirPort Extreme 5th generation on Windows 7

    I’m trying to install an AirPort Extreme 5th generation on Windows 7. The AirPort Utility  installation software is asking for: 1) Router Address Number and 2) DNS Server number.
    Where I find this information? (I have a broadband internet service).
    Thanks in advance for your help.

    You can run the AirPort Extreme in router mode, but you will have a Double NAT issue to deal with, which will slow down the connection on the AirPort and possibly introduce other issues as well. An online gaming console will not work with this type of setup for example.
    Since the AirPort will be on a separate subnet than the Uverse, devices that are connected to the AirPort will not be able to "see" other devices that are connected to the Uverse network.
    That may be a "plus", or a big "minus", depending on your requirements. For example, any devices on the AirPort network would not be able to print to a device on the Uverse network.
    Unless you really do want two separate wireless networks both sharing the same Internet connection, and you want to deal with the Double NAT issue, life would be a lot simpler if the AirPort were configured to operate in Bridge Mode.
    The AirPort will allow you to set up a wireless network in Bridge Mode, if that is what you are after.
    Your call.

  • Help, which windows Service msut be on to run Adobe Bridge CS3?

    hi all,
    I'm having trouble opening Adobe Bridge CS3, theres a windows popup that says "Adobe Bridge has encountered a problem and needs to close" error message when i try to start.
    I can run the other Adobe Cs3 applications fine, i've been playing around with the disabling of windows services to increase bootup time. i'm afraid i may have accidentally disabled something necessary
    pls advice on how to get it working.. i'm on win xp pro sp2
    thanks

    When you get the "Bridge has encountered an error" popup box, check the technical info hyperlink to see what's the problem. It may point to a DLL that had an error.
    From there, check the web to see what that DLL relates to, which may or may not give you a lead. Maybe something that needs to be running in WinXP, maybe a 3rd party product that needs to be fixed/removed/re-installed.
    Why do I say this? I had the same issue on Bridge after getting the trial version. Worked for a while, then suddenly stopped working with the same startup dialog box and a quick shutdown. Digging a bit as above pointed to a DLL that was related to Quicktime. I went to the Apple site and downloaded/installed the latest version of Quicktime, and the Brige problem was cured.

  • How to create a client console to connect to server in windows service using c#

    my code is error
    can you check the code please
    client console code
    partial class Program : ServiceBase
            public static void Main(string[] args)
                serverservice ss = new serverservice();
                ss.myserver();
                    TcpClient tcpc = new TcpClient();
                    Console.WriteLine("connecting.......");
                    tcpc.Connect("10.128.1.116", 80);
                    Console.WriteLine("connected........");
                    Console.Write("enter msg to be transimitt");
                    string str = Console.ReadLine();
                    Stream stm = tcpc.GetStream();
                    ASCIIEncoding asc = new ASCIIEncoding();
                    byte[] ba = asc.GetBytes(str);
                    Console.WriteLine("transmitting..........");
                    stm.Write(ba, 0, ba.Length);
                    byte[] bb = new byte[100];
                    int k = stm.Read(bb, 0, 100);
                    for (int i = 0; i < k; i++)
                        Console.Write(Convert.ToChar(bb[i]));
                    tcpc.Close();
                windows service for server code is
      public partial class serverservice : ServiceBase
            public serverservice()
                InitializeComponent();
            protected override void OnStart(string[] args)
                myserver();
               Thread mythread = new Thread(new ThreadStart(myserver));
                 mythread.Start();
            public void myserver()
                char d;
                IPAddress ipad1 = IPAddress.Parse("10.128.1.116");
                TcpListener tcpc = new TcpListener(ipad1, 80);
                tcpc.Start();
               // System.Diagnostics.Process.Start(@"C:\Users\PC\Documents\Visual Studio 2010\Projects\WindowsFormsApplication1\webs\webs\clientconsole\clientconsole\bin\Debug\clientconsole.exe");
                Console.WriteLine("server is running at port 80");
                Console.WriteLine("local end point is" + tcpc.LocalEndpoint);
                Console.WriteLine("waiting for connection");
              // var client=new TestExecutionEngine
                Socket s = tcpc.AcceptSocket();
                Console.WriteLine("connection is accepted from" + s.RemoteEndPoint);
                byte[] b = new byte[100];
                int k = s.Receive(b);
                Console.WriteLine("received");
                for (int i = 0; i < k; i++)
                    d = Convert.ToChar(b[i]);
              Console.WriteLine(char.ToUpper(d));
                ASCIIEncoding asc = new ASCIIEncoding();
                s.Send(asc.GetBytes("msg is recveived"));
                Console.WriteLine("\n send aknwldge");
                s.Close();
                tcpc.Stop();
               protected override void OnStop()
                EventLog.WriteEntry("stopped");

    kavya --
    You have erroneously posted this question in a user forum dedicated to questions about Project Online, an enterprise project management application.  I would recommend you repost your question in a user forum that deals with C sharp programming questions. 
    Hope this helps.
    Dale A. Howard [MVP]

  • Permissions for Windows Service on Server

    Post Author: bdimon
    CA Forum: Authentication
    I wrote a Windows service running as an Active Directory user. It cannot print on the Windows Server so I wrote a windows application to test the permissions. When a user with local admin rights runs the test application, it prints. He starts the program using the "Run As" option and enters the Active Directory user from the service, he gets the same error as the Windows Service gets. This must be permissions-based.
    When I installed this Windows Service on a staging server, everything was fine. However the staging server was not "secured" by the network team so the Active Directory user had Read/Execute permissions on the C: drive. I do not want to ask for these permissions on the production server's C: drive.
    The error is:
    System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x800002AD): Error in File UNKNOWN.RPT:
    The request could not be submitted for background processing.
       at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       --- End of inner exception stack trace ---
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
       at WindowsApplication1.frmTestServerPrint.PrintCrystalReport(String& ErrorText, String ReportFileName, String PrinterLocation, Int32 PayTransStatusCode)

    Post Author: jgreg311
    CA Forum: Authentication
    I believe I'm having a similar problem, and was hoping to see if either you have found an answer to the problem or reactivate this thread in hopes someone will finally answer us.I'm creating reports using a windows service as well.  The report files are compiled into the DLL, and they are being exported to save them to disk.   The error is being generated when the report object is first accessed (which happens to be when attempting to set the Text property on a TextObject).  It works fine on my development machine.  I've installed the service on the production server using a Visual Studio 2005 Setup and Deployment project.  I added the 2005 Crystal merge module to the setup, so all necessary files should exist on the server.  The service is running as a domain user that has admin rights on the local machine, but we're still getting this error that seems, according to posts I've found online, to be a permissions issue.Here is the exception in its entirety:
    Exception Type:
    System.Exception
    Exception Message:
    Load report failed.
    Exception Stack Trace:
    at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
    at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String
    filename, OpenReportMethod openMethod, Int16 parentJob) at
    CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String
    reportName, OpenReportMethod openMethod, Int16 parentJob) at
    CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport()
    at
    CrystalDecisions.CrystalReports.Engine.ReportDocument.get_ReportDefinition()
    at ...
    Inner Exception:
    System.Runtime.InteropServices.COMException (0x800002AD): Error in File
    UNKNOWN.RPT: The request could not be submitted for background
    processing. at
    CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object&
    DocumentPath, Int32 Options) at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object&
    DocumentPath, Int32 Options) at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() Any help with this would be GREATLY appreciated.  Once again Crystal Reports are the only thing holding up an important project.

  • Diff b/w Web service and window service

    What is the difference between web service and window service, whether the both are same or not, Give some explain about that each one and give some examples also.

    An XML Web service is a component that implements program
    logic and provides functionality for diseparate
    applications. These applications use standard protocols,
    such as HTTP, XML, and SOAP, to access the functionality.
    XML Web services use XML-based messaging to send and
    receive data, which enables heterogeneous applications to
    interoperate with each other. You can use XML Web services
    to integrate applications that are written in different
    programming languages and deployed on different platforms.
    In addition, you can deploy XML Web services within an
    intranet as well as on the Internet. While the Internet
    brings users closer to organizations, XML Web services
    allow organizations to integrate their applications.
    A Windows service starts much before any user logs in to
    the system (if it has been setup to start at boot up
    process). A Windows service can also be setup in such a way
    that it requires a user to start it manually ? the ultimate
    customization!
    Windows services run as background processes. These
    applications do not have a user interface, which makes them
    ideal for tasks that do not require any user interaction.
    You can install a Windows service on any server or computer
    that is running Windows 2000, Windows XP, or Windows NT.
    You can also specify a Windows service to run in the
    security context of a specific user account that is
    different from the logged on user account or the default
    computer account. For example, you can create a Windows
    service to monitor performance counter data and react to
    threshold values in a database.

  • How to launch an application with elevated administrator account privilege from windows service even if the account has not yet logon

    Here is the case:
    OS environment: Windows 7
    There are two user accounts in my system, standard user "S" and administrator account "A", and there is a windows service running with "Local System" privilege.
    Now i logged-in with account "S", and i want to launch an application with elevated administrator account "A" from that service program, so here is the code snippet:
    int LaunchAppWithElevatedPrivilege (
    LPTSTR lpszUsername, // client to log on
    LPTSTR lpszDomain, // domain of client's account
    LPTSTR lpszPassword, // client's password
    LPTSTR lpCommandLine // command line to execute e.g. L"C:\\windows\\regedit.exe"
    DWORD dwExitCode = 0;
    HANDLE hToken = NULL;
    HANDLE hFullToken = NULL;
    HANDLE hPrimaryFullToken = NULL;
    HANDLE lsa = NULL;
    BOOL bResult = FALSE;
    LUID luid;
    MSV1_0_INTERACTIVE_PROFILE* profile = NULL;
    DWORD err;
    PTOKEN_GROUPS LocalGroups = NULL;
    DWORD dwLength = 0;
    DWORD dwSessionId = 0;
    LPVOID pEnv = NULL;
    DWORD dwCreationFlags = 0;
    PROCESS_INFORMATION pi = {0};
    STARTUPINFO si = {0};
    __try
    if (!LogonUser( lpszUsername,
    lpszDomain,
    lpszPassword,
    LOGON32_LOGON_INTERACTIVE,
    LOGON32_PROVIDER_DEFAULT,
    &hToken))
    LOG_FAILED(L"GetTokenInformation failed!");
    __leave;
    if( !GetTokenInformation(hToken, (TOKEN_INFORMATION_CLASS)19, (VOID*)&hFullToken,
    sizeof(HANDLE), &dwLength))
    LOG_FAILED(L"GetTokenInformation failed!");
    __leave;
    if(!DuplicateTokenEx(hFullToken, MAXIMUM_ALLOWED, NULL,
    SecurityIdentification, TokenPrimary, &hPrimaryFullToken))
    LOG_FAILED(L"DuplicateTokenEx failed!");
    __leave;
    DWORD dwSessionId = 0;
    WTS_SESSION_INFO* sessionInfo = NULL;
    DWORD ndSessionInfoCount;
    bResult = WTSEnumerateSessions(WTS_CURRENT_SERVER_HANDLE, 0, 1, &sessionInfo, &ndSessionInfoCount);
    if (!bResult)
    dwSessionId = WTSGetActiveConsoleSessionId();
    else
    for(unsigned int i=0; i<ndSessionInfoCount; i++)
    if( sessionInfo[i].State == WTSActive )
    dwSessionId = sessionInfo[i].SessionId;
    if(0 == dwSessionId)
    LOG_FAILED(L"Get active session id failed!");
    __leave;
    if(!SetTokenInformation(hPrimaryFullToken, TokenSessionId, &dwSessionId, sizeof(DWORD)))
    LOG_FAILED(L"SetTokenInformation failed!");
    __leave;
    if(CreateEnvironmentBlock(&pEnv, hPrimaryFullToken, FALSE))
    dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT;
    else
    pEnv=NULL;
    if (! ImpersonateLoggedOnUser(hPrimaryFullToken) )
    LOG_FAILED(L"ImpersonateLoggedOnUser failed!");
    __leave;
    si.cb= sizeof(STARTUPINFO);
    si.lpDesktop = L"winsta0\\default";
    bResult = CreateProcessAsUser(
    hPrimaryFullToken, // client's access token
    NULL, // file to execute
    lpCommandLine, // command line
    NULL, // pointer to process SECURITY_ATTRIBUTES
    NULL, // pointer to thread SECURITY_ATTRIBUTES
    FALSE, // handles are not inheritable
    dwCreationFlags, // creation flags
    pEnv, // pointer to new environment block
    NULL, // name of current directory
    &si, // pointer to STARTUPINFO structure
    &pi // receives information about new process
    RevertToSelf();
    if (bResult && pi.hProcess != INVALID_HANDLE_VALUE)
    WaitForSingleObject(pi.hProcess, INFINITE);
    GetExitCodeProcess(pi.hProcess, &dwExitCode);
    else
    LOG_FAILED(L"CreateProcessAsUser failed!");
    __finally
    if (pi.hProcess != INVALID_HANDLE_VALUE)
    CloseHandle(pi.hProcess);
    if (pi.hThread != INVALID_HANDLE_VALUE)
    CloseHandle(pi.hThread);
    if(LocalGroups)
    LocalFree(LocalGroups);
    if(pEnv)
    DestroyEnvironmentBlock(pEnv);
    if(hToken)
    CloseHandle(hToken);
    if(hFullToken)
    CloseHandle(hFullToken);
    if(hPrimaryFullToken)
    CloseHandle(hPrimaryFullToken);
    return dwExitCode;
    I passed in username and password of account "A" to method "LaunchAppWithElevatedPrivilege", and also the application i want to launch, e.g. "C:\windows\regedit.exe", but when i run the service program, i found it do launch
    "regedit.exe" with elevated account "A", but the content of regedit.exe is pure back. screenshot as below:
    Can anyone help me on this?

    You code is not dealing with the DACL access to Winsta0\Default.  Only the LocalSystem account will have full access and the interactively logged on user which is why regedit is not displaying properly.  You'll need to grant access to your user. 
    You also need to deal with UAC since that code is going to give you a non-elevated token via LogonUser().  You need to get the full token via a call to GetTokenInformation() + TokenLinkedToken.
    thanks
    Frank K [MSFT]
    Follow us on Twitter, www.twitter.com/WindowsSDK.

  • TNS-12560 error when running as Windows Service

    Hello,
    I created a VB.NET application that connects to a Oracle database using DbProviderFactory and ODP.NET for .Net Framework 2.0. This application runs on XP, I need it to run as Windows Service, but every time it try to connect to the database throw the Oracle exception TNS-12560: TNS:protocol adapter error, the weird thing is the same application running as a Console Application it works (Same code, same connection string, same query). It was using ODP.NET 10 I updated the provider to 11 still got the same error. The service is running user Local System account, and it has the same problem running under other adm account.
    Following is error in the sqlnet.log (PS: The file was under the system32 folder, probably because was running as a service):
    Fatal NI connect error 12560, connecting to:
    +(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XX.XX.XX.XX)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XXX)(CID=(PROGRAM=C:\Program Files\MyApp\MyApp.exe)(HOST=MYCOMPUTER)(USER=MYUSER))))+
    VERSION INFORMATION:
    +     TNS for 32-bit Windows: Version 10.2.0.1.0 - Production+
    +     Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 10.2.0.1.0 - Production+
    Time: 28-AUG-2009 02:20:19
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12560
    TNS-12560: TNS:protocol adapter error
    ns secondary err code: 0
    nt main err code: 530
    TNS-00530: Protocol adapter error
    nt secondary err code: 56
    nt OS err code: 0
    Does anyone have any thoughts as to why I'm getting this error ??
    Thanks

    I don't know :^(
    There could be many reasons: differences in the environment, missing permissions, virus scanners, you name it.
    Is it running under the same user as on the console?
    I suspect that the error code will give a hint where the problem is, but I could not find any documentation what this code means.
    You could try to run an Orace Net trace - maybe you get an idea if you see where in the connection process the problem occurs.
    Yours,
    Laurenz Albe

  • Setting up OIM to start as a Windows Service running under Weblogic 10.3.2

    Hi,
    On recommendation from our Oracle Rep. we have begun migrating our existing OIM installation on Oracle AS to a Weblogic Application Server. As such we are looking for a way to get the OIM application to run as a service in windows - so we dont have to start it manually after a reboot and so that system monitoring can alert us if/when the application crashes for some reason.
    I have asked Oracle support - which basically said that no such howto/documentation exists and that "One needs to debug on their own when face any issue." (whatever the h*** that means).
    I was thinking that we werent the first customers trying to get the OIM webapplication to start automatically under weblogic and that someone must have figured out a way to accomplish this ?
    Any advice on how to do this will be greatly appreciated.
    Thank you in advance.
    /Jacob

    Hi Jacob,
    See this post that I answered few time ago. Re: Keeping Remote Manager running - Windows
    Our OIM is running as a Windows Service.
    REnato

Maybe you are looking for

  • Ical will not open.  crashes immediately

    ical will not open. it crashes immediately. at first, it would open a blank calendar window, spin for a minute and then crash. now it just crashes immediately. i tried updating; but it didn't need it. i tried taking ical app from another mac in the h

  • How to restrict  redundant value in report while using left outer urgent

    Hi frineds       i am developing pp report, i am using the select query,   the output instead of one i ,got two for every one ex reason badm-- onlyone but igives badm                 badm   SELECT FMATNR FAUFNR FPSMNG GXMNGA GPERNR GBUDAT GGRUND GVOR

  • Change password in Weblogic 10.3

    Hi, I follows change password of weblogic admin for change password, I have 2 problems: In step 8, please for me file name to edit WLS_PW (is startManagedWebLogic?) In step 9, I cannot find gateway.ini file If in step 8 and 9, I input password, for e

  • Multiple file search and replace

    Does anyone know if it is possible to do search / replaces in script, text etc over multiple files?  If not, is there any 3rd party software available to do it? I have hundreds of files I have to make the same change in and just wanted to find out be

  • Is there a way to convert videos taken in Photo Booth to iMovie?

    A friend of mine came to visit from out of town and we made some videos using Photo Booth. I tried to drag and drop it into iMovie, because I need to edit some clips, but it wouldn't work. I tried dragging it to iTunes first, but then it only recogni