Link to home
Start Free TrialLog in
Avatar of matley
matley

asked on

set system date and time from other PC

how do i set system date and time of a PC before it loads to windows? i would like to get the info. from other PC.
ASKER CERTIFIED SOLUTION
Avatar of K_2K
K_2K

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of juliancrawford
juliancrawford

You will need to authenticate prior to using the net time command ..

>net use \\127.0.0.1\ipc$ "mypassword" /u:administrator
The command completed successfully.
<---substitute the ip addy and password to suit

now you can issue the net time command above as per K_2K
Avatar of matley

ASKER


K_2K,

i'm using it with 98. where i can find that logon script? is it in Autoexec.Bat? and one more thing, i want it to set without prompting for confirmation.
sorry - didn't realise you were using 98 - disregard my previous post.
Hi matley,

This is going to be extremely difficult for you. Since you are trying to set the time using a time-source on the network, you must have a working network interface and the appropriate drivers loaded. This means that you will need to use MS-DOS based network drivers plus the appropriate network layer stack.

Usually you don't have to worry about these things since Win98 has network drivers and the appropriate network interfaces are initialized when Windows boots up. But since you want to do this before Windows loads...

Another problem you will run into is this: Once you load DOS network drivers, you cannot completely un-load them. If the drivers are loaded when you boot into Win98 it may cause the 32bit Windows network drivers to fail which means that you won't be able to use the network from that system. Or, it may crash Windows entirely.

So.. You're going to habe to find some way to:
1) Load the DOS network drivers and set the time.
2) Reboot the system.
3) Start Win98 without loading the DOS network drivers.

Good luck.

Now, if the requirement to do this before Windows loads is tossed out.. Then it becomes very simple:
net time \\Time_PC_Name /set

Just like K_2K said.

pb
This will list your settings,  including the "Logon script" at about the middle:
     net users %USERNAME% /domain
The domain administrator can add the net time command to that script if it's on the logon servers where it belongs.

I agree with pb, the logon script runs before the desktop renders, so even though windows has started there is no serious problem with doing it the simple way instead of going through all the DOS networking hassles.

Of course, if you're smart like some and have already replaced Window's LAN Manager with a third party networking tool just to play around with alternatives - then you may already have networking available at DOS and be able to find in the autoexec.bat file where that is done.  You'll have to user that networking tool to do whatever time commands come with it.

Enjoy,
2K
(\o/)
Avatar of matley

ASKER

pbarrette,

setting time even after loading windows would be fine. so i created batch file and put it in windows startup folder.  

but i dont want to prompt users for confirmation.

"Do you want to set the local computer's clock to match \\PC_NAME? (Y/N) [Y]:"

 i want it to default to "Y". how can i do that?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of matley

ASKER

gentlemen,

i last thing. i want the MS-DOS window to disappear after executing the batch file.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To make the MS-DOS window to disappear after executing the batch file, use the exit command:
   exit

If you use the logon script to do the commands or start the batch file, it will dissappear before the desktop is displayed anyway.