Xp Batch File Shutdown

  1. Remote Shutdown Batch File
  2. Windows Xp Run Batch File On Shutdown
  3. Shutdown Batch Script

I want to make a batch file to run sfc /scannow & then restart the computer. I use XP Home SP2. I made one with sfc /scannow & shutdown -r but it restarts after sfc /scannow is just starting to run. Jun 13, 2007  RESOLVED Batch File to Shutdown XP Pro If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the. It may be necessary after a batch file is completed its copying or installing process to restart the computer to complete that installation. Below are steps that can be used to restart a computer through a batch file. Windows Vista, 7, and 8 users. Windows XP users. Windows 95, 98, and ME users. MS-DOS users.

Shutdown

The shutdown command is a Command Prompt command that can be used to shut down, restart, log off, or hibernate your own computer.

The shutdown command can also be used to remotely shut down or restart a computer you have access to over a network.

The shutdown command is similar in some ways to the logoff command.

Shutdown Command Availability

The shutdown command is available from within the Command Prompt in Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP operating systems.

The availability of certain shutdown command switches and other shutdown command syntax may differ from operating system to operating system.

Shutdown Command Syntax

shutdown [/i/l/s/r/g/a/p/h/e/o] [/hybrid] [/f] [/m computername] [/txxx] [/d [p:u:]xx:yy] [/c 'comment'] [/?]

See How to Read Command Syntax if you're not sure how to read the shutdown command syntax shown above or described in the table below.

Remote Shutdown Batch File

Each time Windows is shut down or restarted manually, including via the shutdown command, the reason, type of shutdown, and [when specified] comment are recorded in the System log in Event Viewer. Filter by the USER32 source to find the entries.

You can save the output of the shutdown command to a file using a redirection operator. See How to Redirect Command Output to a File for help doing that or see Command Prompt Tricks for more tips.

Shutdown Command Examples

In the above example, the shutdown command is used to restart the computer that's currently being used and records a reason of Other (Planned). The restart is designated by /r and the reason is specified with the /d option, with p representing that the restart is planned and the 0:0 indicating an 'Other' reason.

Remember, major and minor reason codes on a computer can be displayed by executing shutdown without options and referencing the Reasons on this computer table that's displayed.

Using the shutdown command as shown here, the current computer is immediately logged off. No warning message is displayed.

In the above shutdown command example, a remote computer named SERVER is being shut down with a recorded reason of Other (Planned). A comment is also recorded as Planned restart by Tim. Since no time is designated with the /t option, the shutdown will begin on SERVER 30 seconds after executing the shutdown command.

This shutdown command is used to shut down the local computer immediately, since we designated a time of zero with the shutdown /t option.

The zero in this command could easily be changed 10 to delay the shutdown for several seconds, 60 to make the computer shut down in one minute, etc.

Finally, in this last example, the shutdown command is cancelled before it can complete. This applies to any restart or shutdown command. You might use it to cancel something like a timed restart that's scheduled for, say, two minutes from now.

Shutdown Command & Windows 8

Microsoft made it more difficult to shut down Windows 8 than they did with previous versions of Windows, prompting many to search out a way of shutting down via a command.

You can certainly do that by executing shutdown /p, but there are several other, albeit easier, ways of doing so. See How to Shutdown Windows 8 for a complete list.

To avoid commands altogether, you can install a Start menu replacement for Windows 8 to make it easier to shut down and restart the computer.

With the return of the Start Menu in Windows 10, Microsoft again made shutting down your computer easy with the Power option.

Reader Eric writes in with a tip to eliminate hangs and speed up the shutdown process in Windows without installing any extra software.

Whenever I tried to shutdown my work laptop it would take almost five minutes. Five minutes! Since I work in a completely locked-down environment I couldn't look to any third party applications for help. Entering the following shutdown command in the run dialog speeds up my shutdown time dramatically.
shutdown -f -t 0

Advertisement

The command Eric uses immediately forces any open applications to close without warning prior to Windows shutting down. Here's another way to quickly shutdown your Windows computer. Thanks, Eric!

Shutdown, restart, and sleep Vista from the keyboard

Windows Xp Run Batch File On Shutdown

Xp Batch File Shutdown

Most of us still rocking XP are well-versed in the shutdown shortcut: Hit the Windows key, they…

Read more

Shutdown Batch Script

Read

Advertisement