Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a laptop and a desktop on the same workstation. On the desktop I have a virtual that shuts down when the host machine shuts down. Rather than have to remote from the laptop into the desktop to shut the machine down, can I use a batch file to do this? Do I have to be able to access the machine as that machine's administrator then, or can I use an account on the laptop?

Thanks.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

You can use shutdown.

shutdown /s /m \\COMPUTERNAME

There is also psshutdown from Sysinternals, which allows you to specify an admin account and password.

psshutdown \\COMPUTERNAME -u user USERNAME -p PASSWORD -k

share|improve this answer
add comment

There are lot of solutions, you can use shutdown, psshutdown (from Sysinternals), or using PowerShell (a sample script here Remote Shutdown script

share|improve this answer
add comment

The title you provided is about using a batch file to shut down a computer, but you didn't mention the OS you're using (probably DOS/Windows though because you used the term "batch file") and your main question doesn't indicate if you have a mechanism in place to detect the shutdown operation, so I'm providing an answer to shutting down your computer from a batch file:

In Unix (e.g., NetBSD, OpenBSD, FreeBSD, Linux, etc.): shutdown -p now

In Windows, there's a free tool called "Wizmo" by an Assembler programmer named Steve Gibson that will do the job for you -- it provides a variety of shutdown options and can be called from a batch file: http://www.grc.com/wizmo/wizmo.html

In DOS, I'm not aware of any such tool.

I hope that helps.

share|improve this answer
    
He mentioned the OS in the tags. –  paradroid Feb 14 '11 at 2:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.