Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

Script Host Client launched from Windows Service

microsoft.public.windows.vista.security






Speedup My PC
Reply
  #1 (permalink)  
Old 06-27-2007
DavidRF
 

Posts: n/a
Script Host Client launched from Windows Service
Hello,

I have a client/server application that launches a Script Host application
from a Windows Service. The Script Host application launches Excel and opens
an xls file for processing.

This works on Windows 2000 and Windows XP, but on Vista we get an error from
Excel saying "cannot access the file: C:\foo.xls, there are a number of
possible reasons". The Script Host application works fine on Vista by
itself, but when launched from a Windows Service it does not have permission
to read the xls file.

Does anyone have any ideas as to what the problem may be? What extra things
do I need to do on Vista to get my Windows 2000/XP application to work?

Many thanks,
DavidRF


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-27-2007
dmex
 

Posts: n/a
Re: Script Host Client launched from Windows Service

You might need to change the service permissions to run under your user
(careful), or you might no longer be able to run programs though a
service because of the security restrictions.


--
dmex
Reply With Quote
  #3 (permalink)  
Old 06-27-2007
Alun Jones
 

Posts: n/a
Re: Script Host Client launched from Windows Service
"DavidRF" <DavidRF@discussions.microsoft.com> wrote in message
news:204C40FC-B94F-4027-8BCC-7DBEB2574E0F@microsoft.com...
> I have a client/server application that launches a Script Host application
> from a Windows Service. The Script Host application launches Excel and
> opens
> an xls file for processing.
>
> This works on Windows 2000 and Windows XP, but on Vista we get an error
> from
> Excel saying "cannot access the file: C:\foo.xls, there are a number of
> possible reasons". The Script Host application works fine on Vista by
> itself, but when launched from a Windows Service it does not have
> permission
> to read the xls file.
>
> Does anyone have any ideas as to what the problem may be? What extra
> things
> do I need to do on Vista to get my Windows 2000/XP application to work?


I think your problem is most likely to be handled by the Microsoft Office
team by telling you that Office Automation was never designed to be run from
service applications, and must be run in an interactive session.

You may have gotten away with it in the past, simply because services shared
a lot with one of the interactive sessions - I think you will probably have
to find some other way to create your files than to use native Office
Automation.

Alun.
~~~~


Reply With Quote
  #4 (permalink)  
Old 06-27-2007
DavidRF
 

Posts: n/a
Re: Script Host Client launched from Windows Service
"Alun Jones" wrote:

> "DavidRF" <DavidRF@discussions.microsoft.com> wrote in message
> news:204C40FC-B94F-4027-8BCC-7DBEB2574E0F@microsoft.com...
> > I have a client/server application that launches a Script Host application
> > from a Windows Service. The Script Host application launches Excel and
> > opens
> > an xls file for processing.
> >
> > This works on Windows 2000 and Windows XP, but on Vista we get an error
> > from
> > Excel saying "cannot access the file: C:\foo.xls, there are a number of
> > possible reasons". The Script Host application works fine on Vista by
> > itself, but when launched from a Windows Service it does not have
> > permission
> > to read the xls file.
> >
> > Does anyone have any ideas as to what the problem may be? What extra
> > things
> > do I need to do on Vista to get my Windows 2000/XP application to work?

>
> I think your problem is most likely to be handled by the Microsoft Office
> team by telling you that Office Automation was never designed to be run from
> service applications, and must be run in an interactive session.
>
> You may have gotten away with it in the past, simply because services shared
> a lot with one of the interactive sessions - I think you will probably have
> to find some other way to create your files than to use native Office
> Automation.


Thanks for the reply.

Just to clarify. The Windows Service process itself does not run
ScriptHost. The Windows Service spawns an independent ScriptHost executable
which reads the Excel file, processes it internally, and writes one or more
tab-delimited files which can be imported natively into our main application.
Its our way of integrated our application with Microsoft Excel, though we
are encountering the same ScriptHost/Automation problem with other programs
as well.

Has anyone run into the same problem? Is there some setting, flag, or
function argument than can be set so that Script Host processes launched by a
Windows Service can open files?

Thanks,
-DavidRF

Reply With Quote
  #5 (permalink)  
Old 06-27-2007
Alun Jones
 

Posts: n/a
Re: Script Host Client launched from Windows Service
"DavidRF" <DavidRF@discussions.microsoft.com> wrote in message
news:1366F3F5-BB5A-47FB-B561-862D93BC5179@microsoft.com...
> Just to clarify. The Windows Service process itself does not run
> ScriptHost. The Windows Service spawns an independent ScriptHost
> executable
> which reads the Excel file, processes it internally, and writes one or
> more
> tab-delimited files which can be imported natively into our main
> application.


And ... the ScriptHost executable is running in _what_ session? The same
session as the service, with no access to an interactive user or a desktop.
Microsoft has repeatedly dictated that they do not support Office Automation
in anything other than an interactive desktop.

> Its our way of integrated our application with Microsoft Excel, though we
> are encountering the same ScriptHost/Automation problem with other
> programs
> as well.
>
> Has anyone run into the same problem? Is there some setting, flag, or
> function argument than can be set so that Script Host processes launched
> by a
> Windows Service can open files?


Every time I've tried to do Office Automation from a service in XP, it's
worked... more or less, most of the time. Every time I've asked Microsoft
for help, they've said "it was never meant to run from a service, that's
unsupported", so I've done it some other way.

That's not to say that there isn't a solution out there - just that I don't
think you'll get any officially sanctioned solutions, and unofficial
solutions have a habit of being wiped out by the next patch, the next
service pack, or the next release, so I avoid them as much as possible.

Alun.
~~~~


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing a printer with Vista (client) and XP (host) =?Utf-8?B?Q2hyaXMgVG9tc28=?= microsoft.public.windows.vista.general 6 03-02-2010 18:30
XP Host - Vista Client On Adhoc Network BLADESMAN microsoft.public.windows.vista.networking sharing 13 09-21-2009 22:20
How to install Root CA in Vista Client using script?? Todd Johnson microsoft.public.windows.vista.general 0 05-23-2007 20:50
Data Privacy Assessment Service Launched Paul Security News 0 05-15-2007 14:56
Internet Sharing Vista Host to XP Client =?Utf-8?B?VHVkb3I=?= microsoft.public.windows.vista.networking sharing 6 02-22-2007 13:25




All times are GMT +1. The time now is 10:20.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120