try simply executing
/sbin/reboot
Main Topics
Browse All TopicsI need to reboot a Linux server by executing a bat file from a Windows server.
This gets me logged into the server from the command line
putty root@<IP Address> -pw <Password>
When I add this to reboot the server it doesn't work. It didn't recognize any of -d -f or -i switches, so I got rid of them.
-m /etc/init.d/reboot -d -f -i
This left me with
putty root@<IP Address> -pw <Password> -m /etc/init.d/reboot
but Putty gave me an error saying "unable to open command file "/etc/init.d/reboot"
I should also add that this server is not a regular Linux server. It is a Comm Server that runs on Linux.
I connected to the server with putty using the credentials from the script. I traversed to /etc/init.d and entered "reboot"
The server rebooted.
As I am sure the solution is clear to verterans, it is equally clear that I am not a Linux admin. I know just enough to be dangerous.
If the solution is to create a script then I'll need help doing that. I don't understand vi at all.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
"which reboot" returned /sbin/reboot
putty root@<IP Address> -pw <Password> -m /sbin/reboot
I still get "unable to open command file"
I looked in the putty documentation and found a reference how the -m might not work on some embedded devices like routers. This isn't a router, but it something kind of similar.
I'm hoping that is not the case.
Any other suggestions?
I can't get this to work with the version of putty I'm using. You could try autoexpect. It will create a script from your session.
http://expect.nist.gov
All clear: use plink: http://the.earth.li/~sgtat
plink root@<IP Address> -pw <Password> /sbin/reboot
Business Accounts
Answer for Membership
by: kfullartonPosted on 2006-02-23 at 10:32:33ID: 16031650
Is "reboot" an actual file int the /etc/init.d directory? On my redhat system for example, I can run reboot from anywhere as /sbin is in my path. Login to the system and do a "which reboot". Place the result from that after -m in your command.