Hi i'm trying to do a time sync between windows xp and windows 7 machines. windows XP is my back office server and i have 4 windows 7 machines that are my controllers. The windows 7 machines are not connected to the internet. All the windows 7 machines must be synced to Windows XP host server. Can anyone suggest a solution. Thanks in advance.
1)Login into any windows 7 as Administrator user and make sure the XP is pingable using the hostname
**Ping xphostname**
2)Check if the following command works
**net time \\xphostname**
If you are able to see the time of the XP box then proceed with Step 3. If not perform the following steps
a) Add the Ip and hostname of the XP in the **C:\Windows\System32\drivers\etc\hosts** file of the Windows 7 and vice versa.
3)In the windows 7, open notepad with Administrator privileges and create a new file and type the following and save the file as synctime.bat.
***NET TIME \\xphostname /SET /YES***
4)Create a shortcut of the synctime.bat file in the startup folder.
5)To sync the time every day, we need to schedule a task using task scheduler
**Start --- > Search --- >Task Scheduler**
6)Create a new task
7)Name the task “whatever you wish to name” in the General tab and do the following in the Security Options portion
i)Select Run whether user is logged on or not
ii)Select Run with highest Privileges
iii)Select the OS as Windows 7 in the configure for Option
8)Select Triggers tab
i)Create a new trigger to create a daily schedule.
ii)Select On a Schedule in Begin the task drop down and configure a daily schedule you want to run the time sync (Preferably 12:00 AM)
iii)Check Enabled in the bottom.
iV)Create another trigger to execute on start up.
v)Select At StartUp in Begin the task drop down.
vi)Check Enabled in the bottom.
9)Select Action tab
i) Create a new action
ii)In the program/script field browse the path to cmd application in **C:\Windows\System32\cmd.exe**
iii)In the arguments field, paste the path of the batch file created earlier(synctime.bat) .
Press Ok.
To Test the Time Sync.
Note: Try changing the time and date manually and restart the machine to see if the time sync is working.
Related
I have to reboot 5 windows PC every week all located in remote location, I remote desktop to the machine and use command "shutdown -r -t 0" to reboot, but one of the PC won't come up until someone go to it and power down and up again, should I change any setting? its all Win7 PCs. thanks.
You can try something different to do all of this automatically for you.
Click "Start"
Type "Task Scheduler"
Click "Create Task"
Now, you can create a new task that will run every day.
Here are a few important tips for setup:
In the General tab, make sure you select the option to run the event whether or not a user is logged in.
In the Triggers tab, add a new trigger and select Daily and the time for when the event should occur.
In the actions tab, create a new action with a script of something like the following
shutdown -s -t 60 -c "System now shutting down. Save all work."
In the conditions tab, change the settings so that the event will not occur while the machine is in use and delay the event until the system has been inactive for a specified amount of time.
Just on a note, this site is for programming, not IT support. Although this contains batch, this is more about IT support.
Type shutdown /? from a command prompt
also you can create new task to restart you pc by start powershell and Type shutdown -s -t 60 -c
Good luck
i have win 8 home edition (no local policy editor) on my pc if i tried to change my system date or time with a batch file i get the following message :
a required priviledge is not held by the client
that means my administrator account doesnt have the enough privilege to change date through cmd or batch file
i know its easy to solve this issue if it was win 8 pro , because in this case i can change my account privilege through the local policy editor witch is not included in any windows home edition
also im running this batch file throw ms access database so i dont have the ability to to run the batch file in a command prompt opened as Administrator
my question is : how to change my administrator privilege to be able to change system date in this case ?? using registry key or any other way
I have a server thats does automatic backups, now i need to sync that backup files to google drive, but i dont want to login every day into windows server so google drive make the sync.
¿Does anyone know a way to sync or script to upload in background without user interacction?
Well i figured out, so i am posting for everyone who needs to run google drive sync app without enter to windows:
create a sheduled task with action start program pointing to: C:\Program Files (x86)\Google\Drive\googledrivesync.exe
add argunment: /autostart
mark execute to run if the user has not logged in
i have also marked execute with higher privileges
the trigger is at system starts with a delay of 30 seconds, it is very important to make a delay!
uncheck the option thats stops the task if it runs for more than x days, this is because google sync is always running in background.
now i have to copy the backups files to google drive folder with and cmd script + sheduled task.
If you are running on a Windows Server 2003 you can try the following to run Drive as a Service:
Download and install Windows Server 2003 resource kit which can be found here
Open a command prompt and run the following:
C:\Program Files (x86)\Windows Resource Kits\Tools>instsrv GoogleDrive "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"
Next is to change the user for witch the newly added service “GoogleDrive” runs under. Change this to Administrator.
Type the following command in the command prompt to open the services snap in console:
services.msc
Choose properties on GoogleDrive service.
Click on tab “Log On”
Click “This account”, and select Admimistrator. Set appropriate password.
Click Apply and OK
Next is to setup some registry settings for the service. Open the registry editor by typing the following command into the command prompt:
regedit
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GoogleDrive
Create a new key “Parameters”
Add a new string value “Application”, (type REG_SZ). Set the value to the path to C:\Program Files (x86)\Google\Drive\googledrivesync.exe /autostart.
Close Registry Editor
Go back to Services, and start the GoogleDrive service
This was adapted from an article about running Dropbox as a service which can be found here.
Essentially the process is to create a Windows service using the 'srvany.exe' which is a Windows service wrapper that will run any program as a service.
I'm working on Windows Server 2003 and Windows server 2008.
I would like to start a batch script just before the login window is displayed.
I read about adding the script in the Group Policy editor (startup/shutdown) but it's not working (it worked for logon and logoff though).
An alternative would be to use the task scheduler service but it's not working either. Plus, I want to be able to see the results in a cmd window. That means the last alternative - creating a service to do the job - is not an option.
Do you have any idea ?
Thanks.
Control Panel -> Scheduled Tasks -> < follow the prompts>
Not as nice as a service, which you can start and stop through well-behaved commands, but if it is a service you want running at all times, it does the job.
Try adding your script as a user defined service
That way it will get executed before the login prompt;
http://support.microsoft.com/default.aspx?kbid=137890
Though this article says it can't be used for batch scripts, you can call the script from an executable.
Just curious about the different ways vending machine companies / ticket companies get their application to run at startup full screen on a windows host machine.
Now first thing I am thinking is obvioulsy a link to the app in startup with a switch for -fullscreen.
There would be local / group policy as another option also.
Sidetracking a bit how do apps such as Skype work when they offer the "start skype when computer starts" option? registry?
Any thoughts / ideas / experience appreciated. Cheers
There are many ways to get an app to start automatically at Windows startup. The two most popular are
putting it into the Autostart folder
writing a special registry value (there is a kind of autostart section there)
I would guess most apps use one of these mechanisms.
As to "fullscreen mode", most kiosk-type systems / vending machines use a custom software as their GUI, so I guess that is developed to always run full-screen (there is no point in running it otherwise), so there no need to configure it for full-screen mode, it will always run like that.
With windows you do not have to have explorer.exe as your "shell".
The GPO settings "User Configuration > Administrative Templates > System > Custom user interface" can be set to be what ever you want - it could be a program, or a simple batch file.
So for example, you could have a batch file that - mapped a network drive, run a program, if that program terminates, the script then restarts the computer.
You would then use autologon for that computer to logon again and start the process all over again.
Most of the software add them to startup by creating a new REG_SZ value (with application path) at one (or more) of the following locations:
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServices]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce]
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows]
NOTE: It may also be loaded from the [Load] or [Run] sections of your
WIN.INI file, found in the Windows directory, but you should not depend on it.
To start it in MAXIMIZED mode, you can design your application to resize itself to maximize mode on startup.