Page 1 of 1 1
Topic Options
#134463 - 2005-02-24 01:01 PM Run .bat file as local service?
Friz Offline
Lurker

Registered: 2005-02-24
Posts: 3
The organisation I'm currently working for (doing an XP rollout) has Kixtart running several .bat files when a user logs in. Of the many functions these file perform, several of them need to write files to the C:\Windows\System32 directory. Currently the .bat files are being run as the local user which means the local user must have write access to the above mentioned directory. Since I'm not all that keen on continuing to let them have that kind of access, is there a way that we can modify the running of the .bat to use a local system account to run the .bat. Or is using the admin account and password (which I'd rather not have in the script) the only way to go?
Top
#134464 - 2005-02-24 01:06 PM Re: Run .bat file as local service?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
What files are you having to write to the System32 directory?

Do you need to do this every time a user logs on, or could you use the task scheduler?

Top
#134465 - 2005-02-24 01:18 PM Re: Run .bat file as local service?
Friz Offline
Lurker

Registered: 2005-02-24
Posts: 3
That was my first question....
This place has multiple in-house developed apps. Some brainbox decided that it would be easiest if the update files were run every time a user logged on. The .bat file does a bunch of .dll updates and similar functions. Now it comes down to:
A. Changing the code for 50+ applications
B. Having the sorry assed techie contractor coming up with a workaround.

Three guesses as to which option they picked...


Edited by Friz (2005-02-24 01:19 PM)

Top
#134466 - 2005-02-24 07:46 PM Re: Run .bat file as local service?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Continuing on Richard's theme, why not create a scheduled task that runs "At Logon", but uses a domain-admin type account (at least with permissions to write to the System folder) and take the process out lf the logon script.

Look for my TCLib UDF library - with it, you can easily create a script that runs on your workstation and pushes the startup task to a list of remote systems with just 4-5 lines to define the task.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#134467 - 2005-02-24 08:34 PM Re: Run .bat file as local service?
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Well "techie contractor",

take a look at something I made: S.W.A.P. - Start With Admin Powers

Not the most secure method, but my guess is it'll work for you!!!

To install on multiple workstations, one can modify the swapinstaller.kix to a UDF. A new installer script could use an .ini with all computer names as input to install the service...

_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#134468 - 2005-02-25 04:25 AM Re: Run .bat file as local service?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Either use the Taks scheduler or use a scheduled admin script that updates the relevant files on the remote computers.
_________________________
There are two types of vessels, submarines and targets.

Top
#134469 - 2005-02-25 08:51 AM Re: Run .bat file as local service?
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Correct,

scheduletask.udf is an other option and more secure.
Like I said, my option isn't the most secure one, but hey, it IS an option...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#134470 - 2005-02-25 03:07 PM Re: Run .bat file as local service?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
One other option which I have used is to use the SRVANY.EXE/INSTSRV.EXE from the Resouce Kit. One downfall to this is if you use your password and is expires every xx days, you have to change the password to the service as well. Of course, if you do the same thing with a Scheduled Task, this would also be the same..

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#134471 - 2005-02-25 04:29 PM Re: Run .bat file as local service?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Or use dedicated user credentials for this and set the password for this account to not expire. Same goes for the credentials used with the task scheduler.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#134472 - 2005-02-28 09:22 AM Re: Run .bat file as local service?
Friz Offline
Lurker

Registered: 2005-02-24
Posts: 3
OK. A few different options. Luckily, I've move that part to "Phase two" of the roll-out so I'll have time to test each of these options...

Thanks.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.052 seconds in which 0.021 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org