Windows Service runs batch file requiring user responses on WS2003

From: Serg (_at_discussions.microsoft.com)
Date: 08/13/05

  • Next message: Per Pedersen: "Re: Domain Controller Security Policy"
    Date: Fri, 12 Aug 2005 21:40:01 -0700
    
    

    Windows Service runs batch file requiring user responses on Windows Server 2003

    I wrote (.NET) Windows Service for batch files execution.

    Batch file is something like that:

    pscp -pw password roooot@192.168.123.123:/dir/dir/remote_file
    c:\dir\local_file

    (Connect to Linux machine and file to my Server using SSH)

    When I’m connecting to a remote server for the first time through this batch
    file, I see a message in Command Prompt window looking something like this:
    The server's host key is not cached in the registry. You
    have no guarantee that the server is the computer you
    think it is.
    The server's rsa2 key fingerprint is:
    ssh-rsa 1024 7b:e5:6f:a7:f4:f9:81:62:5c:e3:1f:bf:8b:57:6c:5a
    If you trust this host, hit Yes to add the key to
    PuTTY's cache and carry on connecting.
    If you want to carry on connecting just once, without
    adding the key to the cache, hit No.
    If you do not trust this host, hit Cancel to abandon the
    connection.

    So I’m just answering YES and everything is OK. Next time there is no more
    prompt for “yes” or “no”, and all runs smoothly.

    -//-

    Everything is working fine on XP, but not on Windows Server 2003

    -//-

    On W2003, when batch file starts, I don’t see Command Prompt Window at all!
    It’s hidden window now and process hangs, because there no place for
    answering “yes” or “no”.

    However both cmd.exe and pscp are running, and Task Manager confirms that.

    Of course I remember about “Interacting with UI” option for Windows Service,
    of course I tried all
    “Local System” and “Network” options for Win-Service.

    Login account I’m using is Administrator account with all privileges,
    cmd.exe were given all permissions for doing everything it wants too.

    I even tried Impersonalization inside my Windows Service (as Admin, of
    course) but nothing changed…

    Strangely this batch file run on W2003 WITHOUT any problems when I execute
    it directly or from Scheduled Task, or from Windows Application (not Service)
    – I see” Command Prompt’ window and can type “Yes” or “No”.

    I spent more than a week surfing Internet but found no solution.
    I suspect it’s related to W2003 security

    Any help would be appreciated.


  • Next message: Per Pedersen: "Re: Domain Controller Security Policy"

    Relevant Pages

    • Re: Windows Service - Accessing Users Desktop
      ... Why do you need to start a "Windows" application on the server in the first ... what if there is no interactice logon or what if there is no ... the Windows Service is not able to find it. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Fix for: Server Application Unavailable Error after Applying Security Update for IE
      ... > We have identified an issue with the recent MS03-32 Security Update for> Internet Explorer security patch and ASP.NET V1.0 running on Windows XP. ... all requests to ASP.NET applications running on the local IIS 5.1 web> server result in an error message saying "Server Application Unavailable". ... In the meantime,> you can execute the following batch file as a workaround for the issue. ... > Stops the IIS and ASP.NET state services> Deletes and recreates the ASPNET account with a known temporary password> Uses the Windows runas command to launch an executable that creates an ASPNET ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Rebooting 2003 server automatically?
      ... I'm not averse to Microsoft-bashing myself, but rebooting a server just ... because it's Windows seems a bit harsh and unwarranted. ... encounter if you don't reboot? ... Double-clicking a local batch file on a NT5.2 ...
      (microsoft.public.win2000.general)
    • Windows 2000 client cant map network drive on windows server 2003
      ... I have a batch file like the following: ... for all clients (windows 2000 pro and windows xp pro), ... for windows 2000 pro client, when logon to local computer, the batch file ... but have problem to map a share on windows server 2003. ...
      (microsoft.public.windows.server.networking)
    • Re: What is the optimum way to insert data into database every 10 seconds?
      ... I am working on a web application that is supposed to get data from a data source on the net and update the database on the server every 10 seconds 24/7. ... I would use .NET message queues and a couple of windows services. ... The advantage of .NET queues is that if you have machine that is hosting the message queue (that is separate from your windows service machine), the windows service machine gets it's own .NET queue as well. ...
      (microsoft.public.sqlserver.programming)