Windows Service runs batch file requiring user responses on WS2003
From: Serg (_at_discussions.microsoft.com)
Date: 08/13/05
- Previous message: keith: "Re: Granting access based on user location"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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.
- Previous message: keith: "Re: Granting access based on user location"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|