erezlevi Posted January 24, 2008 Share Posted January 24, 2008 hi, does anyone know how can I write a script that restart a computer (win 2003 server), without using the controlsend or send function so it can run even if no one is logged on to the computer? I need a routin restart every day at 00:00. Thanks, Link to comment Share on other sites More sharing options...
Developers Jos Posted January 24, 2008 Developers Share Posted January 24, 2008 Just schedule a "shutdown" command or if you really want a script to do it then use the Autoit3 Shutdown() command .. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
erezlevi Posted January 24, 2008 Author Share Posted January 24, 2008 Just schedule a "shutdown" command or if you really want a script to do it then use the Autoit3 Shutdown() command .. Thanks, just found it. Link to comment Share on other sites More sharing options...
ptrex Posted January 24, 2008 Share Posted January 24, 2008 @all Maybe just use what is already there. SHUTDOWN.exe Shutdown the computer Syntax SHUTDOWN [logoff_option] [/m \\Computer] [options] logoff_option: /i Display the GUI (must be the first option) /l Log off. This cannot be used with /m or /d option /s Shutdown /r Shutdown and Restart /a Abort a system shutdown. (only during the time-out period) /p Turn off the local computer with no time-out or warning (only with /d) /h Hibernate the local computer (only with /f ) /e Document the reason for an unexpected shutdown of a computer options: /m \\Computer : A remote computer to shutdown. /t:xxx : Time until system shutdown in seconds. The valid range is xxx=0-600 seconds. [default=30] /c "Msg" : An optional shutdown message [Max 127 chars] /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!!! /d u:xx:yy : List a USER reason code for the shutdown. /d P:xx:yy : List a PLANNED reason code for the shutdown. xx Specifies the major reason code (0-255) yy Specifies the minor reason code (0-65536) Options in bold are for Windows 2003 onlyExample: To create a desktop shortcut that will immediately shutdown your system - set the shortcut Target Properties to: C:\Windows\System32\shutdown.exe -s When using this command to reboot a server, the shutdown process will normally allow about 30 seconds to ensure each running service has time to stop. The shutdown can be made faster if all the services are first halted using NET STOP e.g. net stop "Microsoft Exchange Internet Mail Service" net stop "Microsoft FTP Service" net stop "Some other Service" SHUTDOWN /t:25 /r Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now