I am working on windows 7. I can sync time of win7 from a ntp linux server manually. How can I do that in command prompt. So I can run it on windows startup. And windows task plan not work for me. The time should be like this:
Linux server --> windows 7.
Any one knows that? Thank you. I can read msdn.
net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"
net start w32time
w32tm /config /update
w32tm /resync /rediscover
.BAT Sample File: https://gist.github.com/thedom85/dbeb58627adfb3d5c3af
I also recommend this program: http://www.timesynctool.com/
Use net time
net time \\timesrv /set /yes
after your comment try this one in evelated prompt :
w32tm /config /update /manualpeerlist:yourtimerserver
If you just need to resync windows time, open an elevated command prompt and type:
w32tm /resync
C:\WINDOWS\system32>w32tm /resync
Sending resync command to local computer
The command completed successfully.
While the w32tm /resync in theory does the job, it only does so under certain conditions. When "down to the millisecond" matters, however, I found that Windows wouldn't actually make the adjustment; as if "oh, I'm off by 2.5 seconds, close enough bro, nothing to see or do here".
In order to truly force the resync (Windows 7):
Control Panel -> Date and Time
"Change date and time..." (requires Admin privileges)
Add or Subtract a few minutes (I used -5 minutes)
Run "cmd.exe" as administrator
w32tm /resync
Visually check that the seconds in the "Date and Time" control panel are ticking at the same time as your authoritative clock(s). (I used watch -n 0.1 date on a Linux machine on the network that I had SSH'd over into)
--- Rapid Method ---
Run "cmd.exe" as administrator
net start w32time (Time Service must be running)
time 8 (where 8 may be replaced by any 'hour' value, presumably 0-23)
w32tm /resync
Jump to 3, as needed.
Related
We may run Firebird as application using command line:
firebird.exe -a -p 3050
Is that possible to shutdown the firebird process using command line too?
There is no "easy" way to do it. If you started firebird.exe as an application, you can quit it by right-clicking on its icon in the taskbar, and selecting shutdown.
The only alternative is to kill it using taskkill, for example:
taskkill /IM firebird.exe
This has the following downsides:
if you have active connections, this will produce a popup to ask for confirmation of shutdown (just like when doing this from the taskbar)
if you have multiple firebird.exe processes, they will all be terminated
You can also force kill to shutdown, this will not produce the popup; open connections will be killed without prompting:
taskkill /F /IM firebird.exe
However, if you regularly need to do this, it might be better to install Firebird as a Window service that doesn't startup automatically. You can then control the service using NET START and NET STOP (or using instsvc).
For example, install Firebird as a service (require administrator command prompt):
instsvc install -demand -name firebird3
This creates a service called "Firebird Server - firebird3"
You can then start and stop the service using NET START "Firebird Server - firebird3" and NET STOP "Firebird Server - firebird3", although this also requires elevated administrator privileges.
I am stuck badly into this.
I am trying to execute following batch command which runs successfully on my system present on same network as remote server,
typeperf "\192.168.1.247\Processor(_Total)\% Processor Time" -sc 2
But if I try to run the same command on another remote server present on same network,
typeperf "\192.168.1.241\Processor(_Total)\% Processor Time" -sc 2
this gives me Error: No valid counters.
Please let me know what could be the issue and what could be the possible solution to this.
Regards,
Suvojit
Try refreshing WMI with this command:
winmgmt /resyncperf & wmiadap /f
Make sure that the WMI service is running, or restart it:
net start winmgmt
Run this command to ensure that the disable key doesnt exist, or its value is 0 if it exists.
REG query HKLM\SYSTEM\CurrentControlSet\Services\PerfProc\Performance /v "Disable Performance Counters"
Try rebuilding the performance registry with the LODCTR /R command.
If nothing else works, you can try to manually rebuild Performance Counter library values as a last resort.
Remote shutting down Windows computer with cmd. Possible?
I have searched over the internet, and I have found many solutions for this problem,
BUT
No one has worked. I don't have got the password for the other computer, or permission to shutdown it, I get everytime: Access denied. (5) So my quetions are:
Is there any software tool to do that?
Is it possible at all?
Can I make it in Windows on both computers?
Not exactly needed cmd, but must be shutted down by remotely, without installing any software on the second computer.
Many thanks for help
I found the solution for you.
RUN secpol.msc in CMD (on the computer u want to enable the remote shutdown)
Go to Local Policies -> User Rights Assignment and search for "Force shutdown from a remote system"
Double click it and then "Add User or Group..." and type "Everyone" and then add it.
This SHOULD work! I've set this configuration on my computer and then executed this command on my brother's PC while we are on the same LAN network and i've got the shutdown message AND the computer did restart.
shutdown -m \\mypcname -r -c "this pc will shutdown in 60 secs" -t 60
Be sure that u can see the computer u want to shutdown trought net view. But u already see it, because u are getting the Access denied. (5).
Report back to the question if it works!
Kind Regards
Look at:
http://www.wikihow.com/Do-a-Remote-Shutdown-for-a-PC-on-a-LAN
quote:
"At your local command prompt type in shutdown -m \computername, replacing "computername" with the name of the computer you wish to shutdown or the computer's IP address."
Or from within a remote session:
shutdown /s /t 0
(meaning: shut down in 0 seconds)
Open cmd
Write net view
Find the computer you want to kick form your wifi or turn off
Write ping ex: USER
Find ip address
Write shutdown -I
I am trying to start windows 7 unattended using the startnet.cmd file. The problem is that when the start setup.exe command is triggered, the setup runs and closes, but cannot reboot because the startnet.cmd is still open. If I put "exit", it starts the setup and exits immediately. Is there a way to check uf the setup ran successfully and then perform an exit?
wpeinit
net use u: \\192.168.2.10\windows
u:
start setup.exe /unattend:\\192.168.2.10\windows\unattend.xml /noreboot
REM ping -n 30 127.0.0.1
REM exit
I think your commands are correct but you explicitly state that setup.exe shall not initiate a reboot after the first phase of the setup procedure has completed.
The black cmd.exe Window will have to remain open during the setup procedure. If it's terminated then Windows PE performs an immediate reboot. Hence your setup.exe process will be terminated. I think your comment using ping to delay the exit very well shows that you have tried to delay terminating the shell process. But as you can't know how long the setup process will take you cannot fill any good value in the delay algorithm.
Although I think you don't need to. You are launching setup.exe using start which detaches the process and returns to the shell immediately. In fact since setup.exe is the last command you run you could also live with the fact that setup.exe is not detached. Either by not using start or by using start /wait
wpeinit
net use u: \\192.168.2.10\windows
u:
setup.exe /unattend:\\192.168.2.10\windows\unattend.xml /noreboot
exit
or
wpeinit
net use u: \\192.168.2.10\windows
u:
start /wait setup.exe /unattend:\\192.168.2.10\windows\unattend.xml /noreboot
exit
Although I think the entire purpose of this would be to return to the shell and perform the exit (which initiates a reboot) command after setup.exe terminates.
As there are no more commands to be executed I suggest letting setup.exe do the reboot itself by removing the /noreboot flag:
wpeinit
net use u: \\192.168.2.10\windows
u:
start setup.exe /unattend:\\192.168.2.10\windows\unattend.xml
This should keep the shell process (cmd.exe) open while setup is running. At the end of the setup process it will initiate a reboot (initiated by setup.exe) and therefore also te
Occasionally a program on a Windows machine goes crazy and just hangs. So I'll call up the task manager and hit the "End Process" button for it. However, this doesn't always work; if I try it enough times then it'll usually die eventually, but I'd really like to be able to just kill it immediately. On Linux I could just kill -9 to guarantee that a process will die.
This also could be used for writing batch scripts and writing batch scripts is programming.
Is there some program or command that comes with Windows that will always kill a process? A free third-party app would be fine, although I'd prefer to be able to do this on machines I sit down at for the first time.
"End Process" on the Processes-Tab calls TerminateProcess which is the most ultimate way Windows knows to kill a process.
If it doesn't go away, it's currently locked waiting on some kernel resource (probably a buggy driver) and there is nothing (short of a reboot) you could do to make the process go away.
Have a look at this blog-entry from wayback when: http://blogs.technet.com/markrussinovich/archive/2005/08/17/unkillable-processes.aspx
Unix based systems like Linux also have that problem where processes could survive a kill -9 if they are in what's known as "Uninterruptible sleep" (shown by top and ps as state D) at which point the processes sleep so well that they can't process incoming signals (which is what kill does - sending signals).
Normally, Uninterruptible sleep should not last long, but as under Windows, broken drivers or broken userpace programs (vfork without exec) can end up sleeping in D forever.
taskkill /im myprocess.exe /f
The "/f" is for "force".
If you know the PID, then you can specify that, as in:
taskkill /pid 1234 /f
Lots of other options are possible, just type taskkill /? for all of them. The "/t" option kills a process and any child processes; that may be useful to you.
Process Hacker has numerous ways of killing a process.
(Right-click the process, then go to Miscellaneous->Terminator.)
JosepStyons is right. Open cmd.exe and run
taskkill /im processname.exe /f
If there is an error saying,
ERROR: The process "process.exe" with PID 1234 could not be
terminated.
Reason: Access is denied.
then try running cmd.exe as administrator.
Get process explorer from sysinternals (now Microsoft)
Process Explorer - Windows Sysinternals | Microsoft Docs
One trick that works well is to attach a debugger and then quit the debugger.
On XP or Windows 2003 you can do this using ntsd that ships out of the box:
ntsd -pn myapp.exe
ntsd will open up a new window. Just type 'q' in the window to quit the debugger and take out the process.
I've known this to work even when task manager doesn't seem able to kill a process.
Unfortunately ntsd was removed from Vista and you have to install the (free) debbugging tools for windows to get a suitable debugger.
setup an AT command to run task manager or process explorer as SYSTEM.
AT 12:34 /interactive "C:/procexp.exe"
If process explorer was in your root C drive then this would open it as SYSTEM and you could kill any process without getting any access denied errors. Set this for like a minute in the future, then it will pop up for you.
FYI you can sometimes use SYSTEM or Trustedinstaller to kill tasks ;)
google quickkill_3_0.bat
sc config TrustedInstaller binPath= "cmd /c TASKKILL /F /IM notepad.exe
sc start "TrustedInstaller"
I had this issue too, here is how I solved it.
1/ Open the « task manager «
2/ Locate the application name in the list
3/ Once found, right click on its name then click on « properties »
4/ In the properties interface, click on « security «
5/ Click on « edit » to change permissions
6/ « Deny » all permissions for all users, click on « apply » then « ok »
7/ click on « advanced » for special permissions settings
8/ Remove permissions for all users
9/ click on « apply » then « ok »
10/ click on « apply » then « ok » again
11/ you can now kill the process on task manager as well as uninstall the app of you want to.
When ntsd access is denied, try:
ZeroWave was designed to be a simple tool that will provide a multilevel termination of any kind of process.
ZeroWave is also a easy-to-use program due to its simple installation and its very friendly graphical interface.
ZeroWave has three termination modes and with the "INSANE" mode can terminate any kind of process that can run on Windows.
It seems that ZeroWave can't kill avp.exe
wmic process where processid="11008" call terminate