General discussion

Locked

Installing Services from a Batch File

By jthompson ·
I have recently installed Timeserv.exe on our PDC and I am looking to automate the installation of timeserv as a service onto our user's pc's via a batch file.
Normally the service is installed by opening RUN and typing timeserv -automatic. Is there a command that I can type into a batch file that will do the same for me?? I understand their may be a problem with admin privileges but that can be worked around.
Thanks in advance

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Installing Services from a Batch File

by -Q-240248 In reply to Installing Services from ...

OS?

Since you use a PDC, run it in the login script..or run a reg file in the login script that runs it in the RunOnce registry entry...Several different ways of doing it..

Collapse -

Installing Services from a Batch File

by jthompson In reply to Installing Services from ...

Poster rated this answer

Collapse -

Installing Services from a Batch File

by JasonC In reply to Installing Services from ...

If all your client Workstations are NT based (Server or Workstation) which I assume is the case from your post, you could use the tools in "AINTX.ZIP" from

http://user.mc.net/cgi-bin/jlh/download

to install the program as a service, but then you would need to write a batch file in the same way as you would to run the "timeserv -automatic" command anyway. I presume you're copying the timeserv.ini file too, at the same time as delivering the timeserv.exe program; could you use a simple batch file that copies the files and then runs timeserv -automatic too??

You could even do an

if not exist %SYSTEMROOT%\System32\Timeserv.ini call [installit.bat]

to look and see if the app is already installed; this way it could become part of the user login script.

Collapse -

Installing Services from a Batch File

by jthompson In reply to Installing Services from ...

Jason, thanks for the prompt answer. I am new to writing batch files so I do not know what commands to use.
I have got the batch file to copy timeserv.ini, .exe and .ddl, and I have tried to use 'start timeserv -automatic' to install it as a service followed by net start timeserv however it does not install the service.
Do I have to be logged on as administrator or am i using an incorrect command? I am at my wits end as i cannot find the specific help i need.

Cheers

John

Collapse -

Installing Services from a Batch File

by JasonC In reply to Installing Services from ...

John.

The users must be able write timeserv.exe to %SYSTEMROOT%\System32 and timeserv.ini to %SYSTEMROOT%. This means that assuming the user is running this as part of their Login Script, they'll need to have write permissions (Local Admin Rights?) to the target directories. One way of avoiding this would be to use your admin rights and put the files directly on to the users' pc.

Logged on as an Administrator, you should be able to put the files on to the local workstations remotely.Try a "net use t: \\workstation-name\c$" in a command prompt from your workstation; this should map t: to the remote c: drive. You can then copy the files manually.
("net use t: /d" to delete the mapping afterwards!)

You've still got the problem of installing the service now that the files are on the local HDD; Normal users won't have permissions to write in the services section of the local registry.

If you're just trying to sync client PC times, why not try out what the MS Article below says; leave the PDC to TimeSync with whatever it's currently talking to, and follow these instructions for setting up the PDC.

http://support.microsoft.com/support/kb/articles/Q131/7/15.asp?LN=EN-GB&SD=gn&FR=0

Then all you'll need to do in the Client Login Script is a

"net time \\pdc /set /yes"

This is literally what your client login .bat will need to say, possibly preceeded with an "@echo off" to keep it tidy! <g>

Good Luck,

Jason.

Collapse -

Installing Services from a Batch File

by jthompson In reply to Installing Services from ...

Poster rated this answer

Collapse -

Installing Services from a Batch File

by jthompson In reply to Installing Services from ...

This question was closed by the author

Back to Networks Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums