Link to home
Start Free TrialLog in
Avatar of kingcastle
kingcastleFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Scripts to close open files and reboot

Hi
So I need to have a script that I can create a shortcut to so when I double click it closes all open files on a remote windows 2008 r2 server, reboots that server and notifies 3 email addresses that server is back up.

Cheers
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Files closing will happen by itself, though it won't cleanly close whatever app has them open for a user on their PC of course with a shared file open.

@echo off
shutdown /m \\remoteserver /r /t 15 /c "Rebooted remotely" /d p:0:0  (or other params as you want see shutdown -?)

Someone else can sort out the emailing if wanted, late was just shutting down PC.....  would monitor PING output and then send a message with a short VBScript, something like this script of mine here:

http://scripts.dragon-it.co.uk/links/batch-monitor-ping-email

Steve
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial