[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Pawan

8/26/2004 3:55:00 PM

Hi All,
I have written a Windows Service which runs a batch file.
Now this file contains command to run executables ....
ie. If the bat file contains ... start notepad ....
start notepad ....

and upon execution on this windows service .... it
actually runs 2 notepad applications ... Just a reminder
that the service is running under Local System Account
policy with 'Interaction with Desktop' set to true
(checked)


Now if I have a case in which the batch file contains
command to execute
some executable from shared network drive ..
I ll get clearer ... Lets say I map a drive M (using user
account x) to
shared drive on server1 ... which contains executable
MYNOTEPAD.EXE ..
M: myfolder on 'server1'


now if i change my batch file to ...
M:
cd\myfolder
start M:\myfolder\MYNOTEPAD.exe

Now when the bat file is executed from my windows service,
the console window comes up .. trys to executes
mynotepad.exe .. it reports "access denied" :(.
Any idea how can I give extra rights to Local System
Account so that it have priviledge to run exes from mapped
drives as well ...


Pawan

1 Answer

Ken Kolda

8/26/2004 4:14:00 PM

0

If you're running Win XP/2003, you should change your service so it runs
under the Network Service account. You will then need to make sure the files
on the mapped drive are accessible either to the Everyone an/or the
Authenticated Users group.

If you're on Win 2000, I believe you have two choices:

1) Change the account under which the service runs to be a domain user that
has access to the specified files.

2) Change the account under which the service runs to be a local user which
has the exact same login and password as a local user on the machine which
is hosting the files (and, of course, ensure that local user has read access
to those files).

I don't believe you can access remote files directly using the Local System
account.

Ken


"Pawan" <pawan_atl@yahoo.com> wrote in message
news:0b1101c48b85$052d1b90$a601280a@phx.gbl...
> Hi All,
> I have written a Windows Service which runs a batch file.
> Now this file contains command to run executables ....
> ie. If the bat file contains ... start notepad ....
> start notepad ....
>
> and upon execution on this windows service .... it
> actually runs 2 notepad applications ... Just a reminder
> that the service is running under Local System Account
> policy with 'Interaction with Desktop' set to true
> (checked)
>
>
> Now if I have a case in which the batch file contains
> command to execute
> some executable from shared network drive ..
> I ll get clearer ... Lets say I map a drive M (using user
> account x) to
> shared drive on server1 ... which contains executable
> MYNOTEPAD.EXE ..
> M: myfolder on 'server1'
>
>
> now if i change my batch file to ...
> M:
> cd\myfolder
> start M:\myfolder\MYNOTEPAD.exe
>
> Now when the bat file is executed from my windows service,
> the console window comes up .. trys to executes
> mynotepad.exe .. it reports "access denied" :(.
> Any idea how can I give extra rights to Local System
> Account so that it have priviledge to run exes from mapped
> drives as well ...
>
>
> Pawan
>