PDA

View Full Version : Running a .BAT file at startup


ian
December 5th 03, 07:21 AM
I have two computers on a LAN:

Computer #1 runs Win98
Computer #2 runs XP Professional

They communicate using Netbeui.

The time-of-day clock on Computer #1 is automatically updated using NTP
every time I connect to the Internet. I now want to use Computer #1's
clock to automatically update the time-of-day clock on Computer #2 every
time it boots up.

I have done this manually at the Computer #2 command prompt, with
something like:

NET TIME \\COMPUTER1 /SET /YES

This works fine. I now want to put this command into a .BAT file and
have XP run this file automatically at startup, after the network
connection to Computer #1 has been established. How do I make XP do
this?

Ian
--

Frank GoBell
December 5th 03, 07:22 AM
ian > wrote:
> I have two computers on a LAN:
>
> Computer #1 runs Win98
> Computer #2 runs XP Professional
>
> They communicate using Netbeui.
>
> The time-of-day clock on Computer #1 is automatically updated using
> NTP every time I connect to the Internet. I now want to use Computer
> #1's clock to automatically update the time-of-day clock on Computer
> #2 every time it boots up.
>
> I have done this manually at the Computer #2 command prompt, with
> something like:
>
> NET TIME \\COMPUTER1 /SET /YES
>
> This works fine. I now want to put this command into a .BAT file and
> have XP run this file automatically at startup, after the network
> connection to Computer #1 has been established. How do I make XP do
> this?
>
> Ian
> --


Put a shortcut of the file into the Start Up folder for the All Users
profile.

You might want to modify the file a bit, so that it reads as follows:

@echo off
net time \\computer1 /set /yes
exit

and save it with a .cmd extension. The exit command will close the window
once the script completes.

--

Frank GoBell

ian
December 5th 03, 07:22 AM
In message >, Frank GoBell
> writes
>
>Put a shortcut of the file into the Start Up folder for the All Users
>profile.
>
[Snip]

Thank you Frank, just what I needed.

Ian

--

Google