mIRC Home    About    Download    Register    News    Help

Print Thread
#145176 19/03/06 08:51 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I have my bot running on a seperate PC, and I'd like to have an mIRC script that would let me send the bot a notice with "!restart" and have it quit the server, exit mIRC, and restart the computer. Is this possible? I have no idea how to go about doing this. Thanks.

#145177 19/03/06 09:00 PM
Joined: Nov 2004
Posts: 148
D
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2004
Posts: 148
If you are using Windows XP SP1 or SP2 or windows 2003 (and such) then you can restart the computer by:

shutdown -r -t 5


You can run it from mIRC:
/run shutdown -r -t 5

Computer will start a 5 seconds countdown

#145178 19/03/06 09:04 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I don't know if it will work from inside mIRC, but you could use try something like this:

Code:
alias reboot {
  quit Rebooting
  .timer -o 1 1 disconnect
  .timer -o 1 3 run shutdown /r /f /t:10
  .timer -o 1 5 exit
}


(untested)

More information on the Shutdown command can be found here: http://www.ss64.com/nt/shutdown.html

-genius_at_work

#145179 20/03/06 01:37 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
what is the f switch for?

shutdown /r /f /t:10

#145180 20/03/06 01:58 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quote:
/f : Force running applications to close.
This will not prompt for File-Save in any open applications.
so will result in a loss of all unsaved data!!!

#145181 20/03/06 02:29 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
RusselB is correct about the switch. I included it because the OP previously mentioned that the computer would be running without a monitor. If there is no monitor, no one would be able to click the confirmation windows.

-genius_at_work

#145182 20/03/06 03:01 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Thanks

#145183 20/03/06 03:39 AM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Thanks for the help. I tried that out and it works. I didn't realize that there would be a Windows command to do that and that made it really easy. Any of you are welcome to come to the server anytime. I don't really have anyone there yet. I'd like the server to have channels for discussion/help about mIRC scripting and Visual Basic programming. I have two channels registered there at the moment (#chat and #VB). I might add one later, probably called #mIRC, just for mIRC scripting if I see that people are going to be on the server, but for now, either of the channels are ok for discussion. The server is braab.myftp.org. Thanks again smile


Link Copied to Clipboard